Install and configure the Samba server in CentOS 7, centossamba
Suppose we have such a scenario
Share Name path permission everyone DOC/smb/docs all personnel including guests can access RDDOCS/smb/tech only allow users in specific groups to read and write access
The group name is RD. Currently, there are two people in the specified group: quwenzhe and zhanghongjie.
1. Install SambaYum-y install samba-client samba-common2. Create a shared directory (assuming files under the shared/smb directory )#Mkdir-p/smb/docs#Mkdir-p/smb/tech3. Configure Kernel Parameters #Ulimit-n 16384#Vi/etc/security/limits. confAdd the following content at the end*-Nofile 163844. Configure the Samba server #Vi/etc/samba/smb. confDelete all original content (run the vi command to delete all content: Use G to go to the end of the file --> ESC -->: 1,. d) and add the following content:
[global] workgroup=BIGCLOUD netbios name=ZZSRV2 server string=Samba Server #security=share security=user map to guest = Bad User[SHAREDOCS] path=/smb/docs readonly=yes browseable=yes guest ok=yes[RDDOCS] path = /smb/tech/ public = no writable = yes write list = @RD validusers = @RD
5. Create a user and assign permissions. // create an operating system user #
Useradd quwenzhe#
Useradd zhanghongjie#
Useradd RD// Modify the user group #
Usermod-a-g rd quwenzhe#
Usermod-a-g rd zhanghongjie// Create a SAMBA user #
Smbpasswd-a quwenzhe#
Smbpasswd-a zhanghongjie// Modify directory permissions #
Chown RD: RD/smb/tech/#
Chmod 770/smb/tech// View service status #
Ll-d/smb/tech
6. Start the Samba server #
Systemctl restart smb#
Systemctl enable smb#
Systemctl status smb
7. Test connectivity // test on Linux #
Smbclient-L localhost-U quwenzhe@123456
// Input in the test run window on Windows
\ 192.168.24.244
Directly upload the target file to the target folder for resource sharing. 8. Access the Samba server in Linux.
Smbclient // 192.168.24.244/rddocs-U quwenzhe
At this point, we have completed the installation and configuration of the Samba server, windows Access to the Samba server, and Linux access to the Samba server. I hope my explanation can help you make progress.