testparm testparam -v | samba configuration check |
smbstatus -b | Check which version you are connected to |
# getenforce Enforcing <- enable SELinux # setenforce 0 <- disable SELinux # getenforce Permissive <- disable SELinux
# vi /etc/sysconfig/selinux #SELINUX=enforcing SELINUX=disabled
/etc/samba/smb.conf
[global] security = user map to guest = Bad User hosts allow = 192.168.0. guest ok = yes guest account = nobody log file = /var/log/samba/log.%m log level = 2 load printers = no dns proxy = no dos charset = cp932 # Windows Client's character(ex for Japanese) unix charset = UTF-8 # Linux Clinet's character client min protocol = SMB3 client max protocol = SMB3 ======================================= [tmp1] path = /home/tmp1 browseable = yes writable = yes [readonly] path = /home/readonly browsable = yes writable = no
[global] dos charset = CP932 # Windows Client's character(ex for Japanese) unix charset = UTF-8 # Linux Clinet's character display charset = UTF-8 # Server's character security = share [share] path = /home/samba/share guest ok = Yes guest only = Yes writable = yes create mode = 0777 directory mode = 0777 share modes = yes [share_www] path = /var/www/html/share guest ok = Yes guest only = Yes writable = yes create mode = 0777 directory mode = 0777 share modes = yes
[global] security = user passdb backend = tdbsam map to guest = Bad User [share] path = /home/share writable = yes guest ok = yes
You need permit only 445.
If you want to access hostname, plese permit more port.
client ----> Permit 445 -----> Samba Server
Guest access in SMB2 is disabled - Windows Server | Microsoft Docs