分类: 嵌入式
2016-05-28 11:29:10
yum install samba samba-client samba-commo chkconfig smb on chkconfig nmb on |
iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT service iptables save |
在正式配置之前,对配置文件进行备份
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak rm /etc/samba/smb.conf touch /etc/samba/smb.conf vi /etc/samba/smb.conf |
[global] workgroup = WORKGROUP security = share map to guest = bad user
[MyShare] path = /home/samba/share valid users = aaron browsable =yes writable = yes guest ok = yes read only = no |
chmod -R 0777 /home/samba/share testparm # 测试配置 smbpasswd –a user #注意,user是配置文件smb.conf中的valid users |
service smb restart service nmb restart service iptables stop setenforce 0 |
注意:可以在/etc/profile设置一个把上边启动命令添加,这样可以避免以后启动时在输入
保存后输入#source /etc/profile,配置即可生效