- 确保服务器ip地址有效
#ifconfig
2、确定服务是否安装
#rpm -qa|grep samba
安装服务
#yum install samba
3、重启服务器
#systemctl restart smb
检查
#systemctl status smb
4、备份配置文件
#cp /etc/samba/smb.conf /root/smb.conf.back
#cp /root/smb.conf.back /etc/samba/smb.conf
5、配置smb服务
#vim /etc/samba/smb.conf
[myshare] 共享名
comment = Itfile 描述
path= /Itmfile 实际本地共享目录
valid users = sam tom 有效用户,空格隔开
writelist = sam 允许用户 sam写
6、创建共享目录与 samba 用户及密码
#mkdir /Itdir
#useradd It1
#useradd It2
#smbpasswd -a It1
123456
#smbpasswd -a It2
123456
更改权限
#chmod It1 /Itdir/
7、重启服务器
#systemctl restart smb 重启
#systemctl status smb 查看服务状态
8、关闭防火墙,关闭selinux
#smbclient -L 192.168.109.133(ip地址)
#smbclient //192.168.109.133/Itgxf -U It1
#exit 退出
进入防火墙
#firewall-cmd --add-service=samba --permanent
重新载入
#firewall-cmd --reload
为目录开启selinux权限
#chcon -t samba_share_t /Itdir/