在自己电脑上面的虚拟机上面安装了nginx,写程序测试的话,每次更改都要上传替换一次,挺麻烦的,于是想装个samba,
1.安装
yum install samba
service smb start
chkconfig --level 235 smb on
2.samba配置文件(这里配置的匿名访问)
vi /etc/samba/smb.conf
#找到"[global]"下的
security = user
#替换成
security = share
#在
[homes]
comment = Home Directories
browseable = no
writable = yes
; valid users = %S
; valid users = MYDOMAIN\%S
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
下面加上
[temp]
comment = Temporary file space
path = /usr/share/nginx/html
writable = yes
browseable = yes
guest ok = yes
#重启samba
service smb restart
3.然后在本机上面就可以访问这个文件夹了,但是权限不够
设置权限
#设置selinux
setsebool -P allow_smbd_anon_write=1
chcon -t public_content_rw_t -R /usr/share/nginx/html
#设置读写权限
setfacl -m u:nobody:rwx -dR html
关于selinux的配置,可见http://www.cnblogs.com/god_like_donkey/archive/2009/07/12/1521930.html
http://blog.163.com/lin_jianying/blog/static/1309355862012149519935/