1.sudo apt-get install samba
2.sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
3.sudo vi /etc/samba/smb.conf
在smb.conf的文件最后加入以下配置并保存,然后退出
[ work ] #ubuntu下的共享目录名称
comment = samba home directory
path = /home/book/ #共享目录路径
public = yes
browseable = yes
public = yes
writeable = yes
read only = no
valid users = lsh
create mask = 0777
directory mask = 0777
#force user = nobody
#force group = nogroup
available = yes
4.sudo smbpasswd -a lsh #新的SMB密码, lsh为ubuntu用户名
5.sudo service smbd restart #重启samba
6.chmod 777 工作目录