Samba shared service
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