ubuntu安装samba

安装:


sudo apt-get install samba
sudo apt-get install smbfs



创建文件夹shared:


mkdir /home/xx/shared
chmod 777 /home/xx/shared


配置:


sudo gedit /etc/samba/smb.conf

;security = user

改为:

security = user
username map = /etc/samba/smbusers



添加:


[Shared]
comment = Shared Folder with username and password

#刚才创建的文件夹
path = /home/xx/shared
public = yes
writable = yes
valid users = ssname
create mask = 0700
directory mask = 0700
force user = nobody
force group = nogroup
available = yes
browseable = yes



修改:


[Global]

workgroup = WORKGROUP
display charset = UTF-8
unix charset = UTF-8
dos charset = cp936

保存smb.conf


添加ubuntu用户:


sudo useradd ssname

给samba用户设置密码:

sudo smbpasswd -a ssname


编辑文件/etc/samba/smbusers

sudo gedit /etc/samba/smbusers



添加内容,如:


ssname = "network username"



保存退出/etc/samba/smbusers


重启,即可开始体验ubuntu的文件共享功能了。

你可能感兴趣的:(ubuntu,samba)