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

Samba shared service

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Systemctl stop firewalld\\ disable selinux Firewall setenforce 0\\ disable selinux mode yum install-y samba\\ install Samba service vi / etc/samba/smb.conf# delete all the contents and add the following [global] # Global configuration It affects everyone workgroup = SAMBA # define workgroup security = user # define security authentication # Security authentication has the following ways: # 1. Share: the client accesses the local machine without a password (anonymous access) # 2. User: requires authentication to access the username and password provided by the host to access the local machine (authentication) # 3. Server: use a separate remote Program host to verify the password provided by the visiting host (centralized management user) # 4. Domain: passdb backend = tdbsam # defines the type of user background using the domain controller for authentication # there are three types (three commands to add samba users) # smbpasswd uses the smbpasswd command to set the password of the samba service program for the system user # tdbsam creates the database file and uses the pdbedit command to establish the samba service program User # ldapsam account verification based on LDAP service introduction of server% v represents samba version number # log file = / var/log/samba/log.%m defines the location and name of the log file Where% m represents the visiting host # max log size = X defines the maximum log file size unit as KB printing = cups # Printer Settings printcap name = cups # Printer Settings load printers = yes # sets whether to share printer devices cups options = raw # printers when the samba server is started. [homes] # Home directory sharing parameters Set the default login directory for Linux users comment = Home Directories # description information valid users =% S % D%W%S # valid user browseable = No # specifies whether sharing information is visible in "network neighbors" read onlyl = No # defines whether to read-only inherit acls = Yes [printers] # Printer sharing parameter comment = All Printers path = / var/tmp # absolute path to the shared directory in the Linux system printable = Yes create mask = 0600 # File permissions After sharing the directory, the user's permission to create files in this directory (for text files) browseable = No [print$] comment = Printer Drivers path = / var/lib/samba/drivers write list = root create mask = 0664 directory mask = 0775 [database] comment = this is test path = / opt/databases # the directory to be shared, if not available, use mkdir / opt/databases

Useradd tom # create tom user pdbedit-a tom # set tom password Note: delete all comments in the samba configuration file (/ etc/samba/smb.conf) if this line reports an error

[root@lq5 ~] # systemctl start smb # enable the samba service [root@lq5 ~] # systemctl enable smb # enable Created symlink from / etc/systemd/system/multi-user.target.wants/smb.service to / usr/lib/systemd/system/smb.service automatically when you boot.

Then go to windows to test.

It will pop up a window that will let you in and out of your account and password. Mine is: user name tom password is 123

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: 0

*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

Servers

Wechat

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

12
Report