1. 安装软件包:
sudo apt-get install samba smbfs
2.修改配置文件
sudo gedit /etc/samba/smb.conf
找到#security = user 这行,用下面两行取代:
security = user
username map = /etc/samba/smbusers
在末尾添加如下内容:
[Share]
comment = Shared Folder with username and password
path = /home/xtx
public = yes
writable = yes
valid users = xtx
create mask = 644
directory mask = 755
available = yes
browseable = yes
其中用户名为xtx,
3.添加用户:
sudo smbpasswd -a xtx
输入密码
4. 开启服务
sudo /etc/init.d/smbd restart