友情帮助:博主参加2014博客之星评选,请大家多多支持哦!投票链接请猛击!
samba,连接Unix阵营和Windows系统的桥梁。在类Unix系统中安装samba服务端,让windows系统像访问共享文件夹一样访问类Unix系统中的指定文件夹。
samba,桑巴舞蹈也是它呢!给一个软件起了这样性感的名字,想想是不是醉了。
有了这个小家伙,解决了我们局域网多个系统互相访问文件的大麻烦。下面是全过程。
sudo apt-get install samba4
/var/lib/dpkg/info/samba4.postinst: 14: /var/lib/dpkg/info/samba4.postinst: /usr/share/samba/setoption.pl: Permission denied dpkg: error processing samba4 (--configure): subprocess installed post-installation script returned error exit status 126 Errors were encountered while processing: samba4 E: Sub-process /usr/bin/dpkg returned an error code (1)
cd /var/lib/dpkg sudo mv info info.bak sudo mkdir info重新install就可以了。
home$ sudo mkdir share home$ sudo chmod 777 share创建一个文件在share文件夹中,一会用它作为访问成功与否的标志。
home$ sudo cp /etc/samba/smb.conf /etc/samba/smb-bk.conf home$ sudo vim /etc/samba/smb.conf找到security = user这一句,如果被注释了,就放开注释。
[Share] comment = Shared Folder path = /home/share public = yes writeable = yes valid users = friend create mask = 0700 directory mask = 0700 force user = nobody force group = nogroup available = yes browseable = yes
display charset = UTF-8 unix charset = UTF-8 dos charset = cp936保存并退出。
home$ sudo useradd friend为friend设置smb密码
home$ sudo smbpasswd -a friend New SMB password: Retype new SMB password: Added user friend.
home$ sudo vim /etc/samba/smbusers friend = "network username"
home$ sudo service smbd restart