1. 修改配置文件

/etc/samba/smb.conf文件末尾添加

[homes]
   comment = Home Directories
   browseable = yes                                            
   read only = no                                   
   create mask = 0775                                         
   directory mask = 0775                                            
   valid users = %S

以上配置是给系统用户的home目录开启samba服务,有效用户是其所有者(valid users = %S)。

2. 添加samba用户

sudo smbpasswd -a username

如果没有什么安全性要求,此处添加的samba用户可以和系统用户相同,而不必再修改smbusers文件将samba用户和系统用户对应起来。

3. 重启samba服务

sudo service samba restart

[附]Arch Linux挂载samba目录

pacman -S smbclient                    # cifs-utils installed as well
smbclient -L hostname -U%        # list public shares on a server
mount -t cifs //SERVER/sharename mnt_point -o user=username,password=password

 

相关文章:

  • 2021-05-19
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2021-08-25
猜你喜欢
  • 2022-12-23
  • 2021-06-16
  • 2021-05-22
  • 2021-12-19
  • 2022-02-16
相关资源
相似解决方案