Ubuntu 16.04 samba 配置

1.首先在Ubuntu系统安装samba服务:

  sudo apt-get insall samba

2.创建共享目录:

  我一般直接把我的home目录整个共享。路径/home/xyp/;

  当然也可以新建其他目录。

3.修改samba配置文件:

  首先保存已有的配置文件:

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

  修改配置文件:

    在配置文件的末尾添加如下内容:

    [xyp]
      comment = Share Folder require password
      browseable = yes
      path = /home/xyp
      create mask = 0666
      directory mask = 0777
      valid users = xyp
      public = yes
      writable = yes
      available = yes

4.创建samba账户

  sudo touch /etc/samba/smbpasswd

  sudo smbpasswd -a xyp

  然后会要求你输入samba帐户的密码

5.重启samba服务器

  sudo /etc/init.d/samba restart

6.测试

  smbclient -L //localhost/xyp

7.windows映射磁盘

  计算机 -> 映射网络驱动器 -> \\server_ip\xyp -> 输入密码

  注意在windows的\\与linux中/的不同。

 

posted on 2017-09-30 09:50  黑大米  阅读(313)  评论(0编辑  收藏  举报

导航