systemctl start smb nmb //启动服务

systemctl restart smb nmb // 重启服务

systemctl enable smb nmb //添加开机启动

firewall-cmd --permanent --add-service=samba && firewall-cmd --reload // 防火墙放行

/etc/samba/smb.conf 配置文件

[root@bogon ~]# cd /etc
[root@bogon etc]# cd samba
[root@bogon samba]# ls
lmhosts  smb.conf  smb.conf.example
[root@bogon samba]# cat smb.conf
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
	workgroup = SAMBA
	security = user

	passdb backend = tdbsam

	printing = cups
	printcap name = cups
	load printers = yes
	cups options = raw

[homes]
	comment = Home Directories
	valid users = %S, %D%w%S
	browseable = No
	read only = No
	inherit acls = Yes

[printers]
	comment = All Printers
	path = /var/tmp
	printable = Yes
	create mask = 0600
	browseable = No

[print$]
	comment = Printer Drivers
	path = /var/lib/samba/drivers
	write list = @printadmin root
	force group = @printadmin
	create mask = 0664
	directory mask = 0775

[html]
server string = public
security = root
encrypt passwords =yes
smb passwd file = /etc/samba/smbpasswd
[code]
workgroup = root
netbios name =www
path = /home/html
browseable = yes
writeable = yes

为samba用户www设置一个密码:
smbpasswd -a www