samba用户权限配置 您所在的位置:网站首页 debian给用户root权限 samba用户权限配置

samba用户权限配置

2023-09-02 01:55| 来源: 网络整理| 查看: 265

   开始前先上主要配图

    这个图片主要说明了各个配置的用途.

    

    安装samba的方法网上有很多,这里不说了。

    安装完毕后先在linux下创建用户(注意用户的格式,好像是要小写开头)

 

sudo adduser XXX

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

sudo usermod -g YYY XXX

 

   那如何添加组呢?

 

sudo groupadd YYY

 

    

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

 

sudo pico /etc/samba/smb.conf

    好了接下来就把主要的配置文件配置好

 

 

[AA] 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 [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

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

 

 

sudo mkdir kkkk sudo chmod 777 kkkk

    最后就得重新重启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 # are not shown in this example # # Some options that are often worth tuning have been included as # commented-out examples in this file. # - When such options are commented with ";", the proposed setting # differs from the default Samba behaviour # - When commented with "#", the proposed setting is the default # behaviour of Samba but the option is considered important # enough to be mentioned here # # NOTE: Whenever you modify this file you should run the command # "testparm" to check that you have not made any basic syntactic # errors. #======================= Global Settings ======================= [global] ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of #jack modify workgroup = JACK server string = jack Test File Server security = user encrypt passwords = yes smb passwd file = /etc/passwd # Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server # wins support = no # WINS Server - Tells the NMBD components of Samba to be a WINS Client # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both ; wins server = w.x.y.z # This will prevent nmbd to search for NetBIOS names through DNS. dns proxy = no #### Networking #### # The specific set of interfaces / networks to bind to # This can be either the interface name or an IP address/netmask; # interface names are normally preferred ; interfaces = 127.0.0.0/8 eth0 # Only bind to the named interfaces and/or networks; you must use the # 'interfaces' option above to use this. # It is recommended that you enable this feature if your Samba machine is # not protected by a firewall or is a firewall itself. However, this # option cannot handle dynamic or non-broadcast interfaces correctly. ; bind interfaces only = yes #### Debugging/Accounting #### # This tells Samba to use a separate log file for each machine # that connects log file = /var/log/samba/log.%m # Cap the size of the individual log files (in KiB). max log size = 1000 # If you want Samba to only log through syslog then set the following # parameter to 'yes'. # syslog only = no # We want Samba to log a minimum amount of information to syslog. Everything # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log # through syslog you should set the following parameter to something higher. syslog = 0 # Do something sensible when Samba crashes: mail the admin a backtrace panic action = /usr/share/samba/panic-action %d ####### Authentication ####### # Server role. Defines in which mode Samba will operate. Possible # values are "standalone server", "member server", "classic primary # domain controller", "classic backup domain controller", "active # directory domain controller". # # Most people will want "standalone sever" or "member server". # Running as "active directory domain controller" will require first # running "samba-tool domain provision" to wipe databases and create a # new domain. server role = standalone server # If you are using encrypted passwords, Samba will need to know what # password database type you are using. passdb backend = tdbsam obey pam restrictions = yes # This boolean parameter controls whether Samba attempts to sync the Unix # password with the SMB password when the encrypted SMB password in the # passdb is changed. unix password sync = yes # For Unix password sync to work on a Debian GNU/Linux system, the following # parameters must be set (thanks to Ian Kahan


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有