ubuntu 开启samba

sudo apt-get update

sudo apt-get install samba samba-common

sudo mkdir /home/vagrant/share

sudo chmod 777 /home/vagrant/share

sudo smbpasswd -a vagrant //vagrant 这个用户必须存在才行,这里设置密码

sudo vim /etc/samba/smb.conf

末尾加上

[share]
comment = Shared Folder require password
path = /home/vagrant/code
public = yes
writable = yes
valid users = vagrant
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
available = yes
browseable = yes

path  路径
valid users  用户名

sudo service smbd restart

至此可在windows连接






上一篇:Vagrant


下一篇:白色死亡屏幕 – 在PHP / Vagrant环境中没有显示错误(Yii)