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