samba for RHEL8
install
# dnf install samba samba-client samba-common
サービス起動設定
# systemctl start smb
# systemctl enable smb
# systemctl status smb
firewall設定
$ firewall-cmd --permanent --add-service=samba
$ firewall-cmd --reload
共有用ディレクトリ作成と設定
# mkdir -p /srv/samba/anonymous
# chmod -R 0777 /srv/samba/anonymous
# chown -R nobody:nobody /srv/samba/anonymous
chconユーティリティを使用して、作成したsamba共有ディレクトリのSELinuxセキュリティコンテキスト
# chcon -t samba_share_t /srv/samba/anonymous
smb設定(匿名共有のセクションを追加)
[global]
workgroup = WORKGROUP
netbios name = rhel
security = user
...
[Anonymous]
comment = Anonymous File Server Share
path = /srv/samba/anonymous
browsable = yes
writable = yes
guest ok = yes
read only = no
force user = nobody
samba構成チェックとサービス再起動
# testparm
# systemctl restart smb
samba接続ユーザ設定(anonymousできない場合)
# pdbedit -a ユーザー名(すでに作成してあるユーザを指定:例)masa)