TOP ▲ itcore TOPTIPSsamba_centos7.php  タグ:samba centos7

samba インストール centos7 | itcore 2018年

インストール

# yum install -y samba samba-client samba-common

共有フォルダの作成

# mkdir -p /pool/share
# chmod 0777 /pool/share
# chown nobody:nobody /pool/share
# cp -ip /etc/samba/smb.conf /etc/samba/smb.conf_`date "+%Y%m%d"`
# vi /etc/samba/smb.conf
追加
[global]
   unix charset = UTF-8
   dos charset = CP932
   mangled names = no
   vfs objects = catia
   catia:mappings = 0x22:0xa8,0x2a:0xa4,0x2f:0xf8,0x3a:0xf7,0x3c:0xab,0x3e:0xbb,0x3f:0xbf,0x5c:0xff,0x7c:0xa6
   interfaces = 127.0.0.0/8 10.0.0.0/24
[share]
    path = /pool/share
    browsable =yes
    writable = yes
    read only = no
    guest ok = no
    guest only = no
    create mode = 0770
    directory mode = 0770
    valid users = @share

sambaの再起動

# systemctl enable smb.service
# systemctl enable nmb.service
# systemctl restart smb.service
# systemctl restart nmb.service

firewall

# firewall-cmd --permanent --zone=public --add-service=samba
# firewall-cmd --reload

アカウント作成

# useradd -m yamada
# pdbedit -a yamada
パスワード入力

# グループ作成

groupadd share
chgrp -R share /pool/share
chmod -R 2770 /pool/share

# グループへのアカウント参加

gpasswd -a yamada share

アクセス確認

\\10.0.0.34