# yum install samba
# yum install samba-client cifs-utils
# pdbedit -L
# pdbedit -a -u <ユーザ名>
# groupadd SmbAdmin
# usermod -G SmbAdmin -a user1
# groupadd SmbUsers
# usermod -G SmbUsers -a <ユーザ名>
管理グループ(SmbAdmin)に属するユーザがファイル作成/削除できるよう既定の拡張ファイル属性を設定。
# cd /home
# mkdir Shared
# chown nobody:SmbUsers Shared
# chmod 777 Shared
# setfacl -m d:g:SmbAdmin:rwx /home/Shared
[global]
unix charset = UTF-8
dos charset = CP932
; display charset = UTF-8
wide links = yes
follow symlinks = yes
unix extensions = no
smb ports = 445
map to guest = Bad User
; max protocol = SMB3
workgroup = WORKGROUP
hosts allow = 127. 192.168.1. 10.8.1.
security = user
; CUPS を無効化
printing = bsd
[homes]
browseable = no
writable = yes
valid users = %U
[Shared]
path = /home/Shared
read only = no
browseable = yes
force group = SmbUsers
force create mode = 664
force directory mode = 775
valid users = <ユーザ1>, <ユーザ2>, @SmbUsers
; samba 4.x で share modes は廃止
; share modes = yes
dos filetimes = yes
# chkconfig --list smb
# chkconfig smb on
# chkconfig --list smb
# service smb restart
# chkconfig --list nmb
# chkconfig nmb on
# chkconfig --list nmb
# service nmb restart
# systemctl enable smb nmb
# systemctl restart smb nmb
# system-config-firewall
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>Samba-VPN</short>
<description>This option allows you to access and participate in Windows file and printer sharing networks. You need the samba package installed for this option to be useful.</description>
<port protocol="tcp" port="445"/>
<destination ipv4="192.168.1.0/24"/>
</service>
# firewall-cmd --permanent --add-service=samba-vpn
# firewall-cmd --reload
# setsebool -P samba_enable_home_dirs 1
# setsebool -P samba_export_all_rw 1
# setsebool -P samba_enable_home_dirs 1
# setsebool -P samba_export_all_rw 1
# chcon -t samba_share_t /home/Shared
# mount -t cifs -o username=<Windowsのアカウント名> //<WindowsマシンのIPアドレス>/<フォルダ> <マウントポイント>
# mount -f cifs username=user1 //WinPC1/Shared /mnt/WinPC1_Shared/
mount: 間違ったファイルシステムタイプ、不正なオプション、
//WinPC1/Shared のスーパーブロックが不正、コードページまたは
ヘルパープログラムの未指定、或いは他のエラー
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so
# dmesg | tail
CIFS VFS: cifs_mount failed w/return code = -22
# yum install cifs-utils
getpeername failed. Error was Transport endpoint is not connected
getpeername failed. Error was 通信端点が接続されていません
printing = bsd