ubuntu16.04 搭建samba环境

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zyq_hh/article/details/85037520

ubuntu16.04 搭建samba环境

安装

  • 下载samba
root@ubuntu:/home# apt-get install samba
root@ubuntu:/home# service smb start
  • 修改配置文件

具体每一项的含义,smb.conf内有说明,需要了解的,稍微看一下就明白;按照我的步骤进行,亲测有效

root@ubuntu:/home# vim /etc/samba/smb.conf 
[share]
comment = Share Folder require password
browseable = yes
path = /home/share
create mask = 0777
directory mask = 0777
valid users = share
force user = nobody
force group = nogroup
public = yes
writable = yes
available = yes
  • 重启samba服务
root@ubuntu:/home# /etc/init.d/samba restart
Restarting nmbd (via systemctl): nmbd.service.
Restarting smbd (via systemctl): smbd.service.
Restarting samba-ad-dc (via systemctl): samba-ad-dc.service
  • 创建共享目录
mkdir /home/share
chmod -R 777 /home/share
  • 创建新用户
sudo groupadd share -g 6000
sudo useradd share -g 6000 -s /shin/nologin -d /dev/null
smbpasswd -a share //设置一下密码即可

以上操作,就配置好了samba服务器了,可以在windows上创建一个磁盘映射,方便今后工作使用。

猜你喜欢

转载自blog.csdn.net/zyq_hh/article/details/85037520