一. samba的安装:

# sudo apt-get install samba

# sudo apt-get install smbfs

  注意:ubuntu 16.04 只需执行 sudo apt-get install samba

 

二. 创建共享目录,或是找已经存在的文件夹,只要权限放开就行了:

# mkdir /home/meiming/share/server_share

# chmod 777 /home/meiming/share/server_share

 

三. 创建Samba配置文件:

1. 保存现有的配置文件

# sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

2. 打开现有的文治文件

# sudo gedit /etc/samba/smb.conf

在smb.conf最后添加

[server_share]

          path = /home/meiming/share/server_share

          available = yes

         browseable = yes

         public = yes

         writable = yes

         valid users = meiming,root

         security = user

 

四. 创建samba帐户

#sudo touch /etc/samba/smbpasswd

#sudo smbpasswd -a meiming

#sudo smbpasswd -a root

 

五. 重启samba服务器

sudo /etc/init.d/samba restart

 

六.测试 smbclient -L //localhost/server_share

 

指定的网络名不可用:  sudo apt-get install libtalloc2