yum list|grep samba
若是不能运行的话, 看下网络是否开启, linux
service network status
还有其余的缘由的话, 百度下 什么缘由shell
须要安装 samba samba-clientvim
yum -y install samba samba-client
本身爱好 是否设为开机启动网络
chkconfig smb on
须要开放几个端口tcp
打开 /etc/sysconfig/iptables 加上下列 代码spa
-A INPUT -m state --state NEW -m tcp -p tcp --dport 137 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 138 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 389 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 901 -j ACCEPT
service iptables restart
selinux 的设置
rest
setsebool -Psamba_enable_home_dirs on setsebool -Psamba_export_all_rw on getsebool -a | grep samba
以上是samba的外围设置 code
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
samba 的无帐户登陆
ip
vim /etc/samba/smb.conf
security = user 改成 security = share |
#命名文件路径 [pathName] path= absolutePath comment = comment public = yes writeable = yes browseable = yes guest ok = yes |
samba 单个帐户登陆 get
useradd test001 smbpasswd -a test001
编辑 /etc/samba/smb.conf
security = user |
#命名文件路径 [pathName] path= absolutePath comment = comment public = yes writeable = yes browseable = yes vaild users = test001
service smb restart