1,安装samba
bash
sudo apt-get install samba openssh-server
2,编辑配置文件:
bash
sudo gedit /etc/samba/smb.conf
然后在文件末尾加入下面代码:
bash
[aping] #samba user
comment = Samba server's share
path = /home/aping
available = yes
writeable = yes
security = share
browseable = yes
public = yes
valid user = aping #ubuntu user name
force user = aping
create mask = 0644
force create mask = 0644
directory mask = 0755
sudo smbpasswd -a aping #ubuntu user name
sudo /etc/init.d/smbd restart
然后保存退出。
3,重启samba 服务
bash
sudo /etc/init.d/smbd restart
4,在window 文件管理器右键,弹出菜单添加网络位置,输入\\xxx.xxx.xxx.xxx\共享目录