Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos7 configuration samba

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Basic installation

Yum install samba

After the installation is complete, go to the configuration file directory

Cd / etc/samba/

Vi / etc/smb.conf (remember to back up)

About the contents of smb.conf, make the following introduction:

# Global configuration information [global] # set the workgroup or domain to which Samba Server will join. Workgroup = SAMBA # generally use share or user,share without authentication User needs to be authenticated security = user # passdb backend means user backend. There are currently three types of backend: smbpasswd, tdbsam, and ldapsam. Sam should be an abbreviation for security account manager (secure account Management). 1.smbpasswd: this way is to use smb's own tool smbpasswd to set a Samba password to the system user (real user or virtual user), and the client uses this password to access Samba resources. The smbpasswd file is in the / etc/samba directory by default, but sometimes it is created manually. 2.tdbsam: this way is to use a database file to build the user database. The database file called passdb.tdb is in the / var/lib/samba/private/ directory by default. # passdb backend = tdbsam # set the type of Samba shared printer. Now supported printing systems are: bsd, sysv, plp, lprng, aix, hpux, qnx printing = cups # to set the configuration file of the shared printer. Printcap name = cups # sets whether the printer is shared when Samba is started. Load printers = yes cups options = raw # user home directory settings. Generally delete this home directory configuration (personal habit) [homes] comment = Home Directories valid users =% S,% D%w%S browseable = No read only = No inherit acls = Yes # printer configuration Default regardless of [printers] comment = All Printers path = / var/tmp printable = Yes create mask = 0600 browseable = No# printer configuration By default, it doesn't matter [print$] comment = Printer Drivers path = / var/lib/samba/drivers write list = root create mask = 0664 directory mask = 0775 # self-added directory configuration [teststorage] # folder name accessed comment = owncloud # Directory remarks path = / ftp/upload # path to the directory writable = yes # Note: for more configuration, please see the help manual.

After configuring the configuration file, restart the service.

Service smb restart

Then add the smb access user (the smb user depends on the system user, so the added user system must have. ) (virtual users and ldap users are synchronized without detailed explanation)

Smbpasswd-a zhangsan

View the list of users that have been added to the smb database:

Pdbedit-L

More pdbedit commands are as follows:

Pdbedit-a username: create a new Samba account.

Pdbedit-x username: delete the Samba account.

Pdbedit-L: list Samba users and read passdb.tdb database files.

Pdbedit-Lv: lists the details of the list of Samba users.

Pdbedit-c "[D]"-u username: suspend the Samba user's account.

Pdbedit-c "[]"-u username: restore the account of this Samba user.

Finally, the windows client can access it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 291

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report