如何进行Samba用户及权限管理

 时间:2026-02-13 08:55:04

1、通过以下命令将用户XXX添加到组YYY里面

sudo usermod -g YYY XXX

接下来就配置samba的smb.conf文件。如无意外,通过如下命令可以打开编辑smb.conf配置文件:sudo pico /etc/samba/smb.conf.

   

  

如何进行Samba用户及权限管理

2、comment = AA

  path = /samba/A

  public = no

  valid users = b02,b01,c01,a01,@A

  write list = @A 

  printable = no

[BB]

  comment = BB

  path = /samba/B

  public = no

  valid users = a01,c01,b01,@B

  printable = no

  write list = @B

如何进行Samba用户及权限管理

3、[CC]

  comment = CC

  path =  /samba/C

  public = no

  valid users = a01,b01,c01,@C

  printable = no

  write list = @C

[public-readonly]

  comment = public-readonly

  path = /samba/public-readonly

  public = yes

  read only = yes


[share-rw]

  comment = share-rw

  path = /samba/share-rw

  public = yes

  writable = yes

#sudo chmod 1777 /samba/share-rw

    

如何进行Samba用户及权限管理

4、 配置好了之后,建立知道的文件夹,然后开放文件夹权限。类似

sudo mkdir kkkk

sudo chmod 777 kkkk

    

如何进行Samba用户及权限管理

5、最后就得重新重启samba啦

sudo /etc/init.d/samba restart

 贴上我自己的smb.conf配置文件内容

#

# Sample configuration file for the Samba suite for Debian GNU/Linux.

#

#

# This is the main Samba configuration file. You should read the

# smb.conf(5) manual page in order to understand the options listed

# here. Samba has a huge number of configurable options most of which 

如何进行Samba用户及权限管理

  • PS图像模式如何设置
  • 如何使用level2软件
  • vray的vfb参数、corona的lut滤镜后期加载方法
  • 桃花源记在哪里查看宠物培养情况
  • Unity UGUI背包系统(二) 之 制作背包的UI界面
  • 热门搜索
    如何微信营销 如何下载电影到u盘 如何设置开机启动项 黄金如何交易 左眼皮跳是什么预兆 wifi怎么读音 七宝美髯丸效果如何 fruit是什么意思 lgbt是什么意思 维卫智能马桶怎么样