1.安装samba服务器
sudo apt-get install samba smbclient cifs-utils samba-common
2.建立共享文件夹并修改权限
mkdir /home/xxx/work
chmod 777 /home/xxx/work
3.修改配置文件
sudo vim /etc/samba/smb.conf
在文件最后添加:
[work]
comment = work
path = /home/ctx/work
browseable = yes
create mask = 0664
directory mask = 0775
#valid users = share
force user = ctx
force group = ctx
public = yes
writable = yes
available = yes
下面是对配置的简单注释
[www] //这是共享时显示的名称
comment = '这是该共享的注释' //注释
path = /var/www //路径
public = yes //是否开放
writable = yes //是否可写
valid users = www //访问的用户
create mask = 0777 //创建权限 (0777为最大权限)
directory mask = 0777 //目录权限
force user = nobody //目标用户
force group = nogroup//目标组
available = yes //是否启用
browseable = yes //是否可浏览
4.关闭防火墙,重启samba服务
sudo ufw disable
sudo /etc/init.d/samba restart