ubuntu下实现和windows共享文档

 1.当然得先安装samba的东东了
sudo apt-get install samba smbfs

2.编辑smb.conf
sudo vim /etc/samba/smb.conf
找到   ; security = user
用下面两行取代:
security = user
username map = /etc/samba/smbusers

把下列几行新增到文档的最后面,
假设允许访问的用户为:weijianhua,而文档夹的共享名为 Share ,

[Share]
comment = Shared Folder with username and password
path = "需要共享的文档目录"
public = yes
writable = yes
valid users = weijianhua
create mask = 0700
directory mask = 0700
force user = nobody
force group = nogroup
available = yes
browseable = yes

然后找到[global]把 workgroup = MSHOME 改成

workgroup = WORKGROUP
display charset = UTF-8
unix charset = UTF-8
dos charset = cp936
3.新增用户的samba密码: (这个很重要!!!)

sudo smbpasswd -a weijianhua
sudo gedit /etc/samba/smbusers
在新建立的文档内加入下面这一行并保存

weijianhua = "network username"
4.重启samba服务:

sudo /etc/init.d/samba restart
最后退出重新登录或重新启动一下机器。
这样就能够在windows直接映射网络磁盘了,方便了……

你可能感兴趣的:(windows,ubuntu,Security,user,文档,NetWork)