更新当前软件
sudo apt-get upgrade
sudo apt-get update
sudo apt-get dist-upgrade
安装samba服务器
sudo apt-get install samba samba-common
添加用户
(下面的zhongshan是我的用户名,之后会需要设置samba的密码)
sudo smbpasswd -a zhongshan
配置samba的配置文件
sudo vim /etc/samba/smb.conf
在配置文件smb.conf的最后添加下面的内容:
[zhongshan]
comment = zhongshan
browseable = yes
path = /home/zhongshan
create mask = 0700
directory mask = 0700
valid users = zhongshan
force user = zhongshan
force group = zhongshan
public = yes
available = yes
writable = yes
重启samba服务器
(注:每次配置完,必须重启samba服务)
sudo service smbd restart