Ubuntu 18.04安装配置Samba服务

1、apt-get install samba

2、备份smb.conf

@ubuntu:~$ sudo cp /etc/samba/smb.conf  /etc/samba/smb.conf.bak
[sudo] password for user: 
@ubuntu:~$ ls /etc/samba
gdbcommands  smb.conf  smb.conf.bak  tls

3、gedit /etc/samba/smb.conf

在smb.conf最后加入以下配置并保存,然后退出

[work]
    comment = samba home directory 
    path = /home/user/
    public = yes
    browseable = yes
    public = yes
    read only = no
    valid users = user
    create mask = 0777
    directory mask = 0777 
    force user = nobody
    force group = nogroup
    available = yes

4、增加samba用户, 一定要操作这一步,否则windows上访问时输入用户名和密码会不对,访问不了

sudo smbpasswd -a user

New SMB password:

Retype new SMB password:

5、重新启动samba,service smbd restart

6、ifconfig查看你的IP地址 ,这个地址为之前固定下来的IP地址

7、在windows上访问刚配置好的samba

8、现在可以正常读写了。 记得要将要共享的目录权限改过来

chmod 777 work

原创文章 96 获赞 48 访问量 6万+

猜你喜欢

转载自blog.csdn.net/wteruiycbqqvwt/article/details/105894520
今日推荐