Suppose we have such a scene
share name path permissionsSharedoc/smb/docs all personnel, including guests, can accessrddocs /smb/tech only allow read and write access for users of specific groups
The group name of the specific group is Rd, currently has Quwenzhe, Zhanghongjie two people
1. Installing Samba
yum-y Install samba samba-client Samba-common 2, create a shared directory (assuming a file in the shared/SMB directory)#
mkdir-p/smb/docs #
mkdir-p/smb/tech 3. Configuring Kernel Parameters#
ulimit-n 16384 #
vi/etc/security/limits.conf at the end, add the following :
*-Nofile 163844. Configuring the Samba server #
vi/etc/samba/smb.conf Delete all content (vi delete all contents command: Go to the end of the file with G-->esc-->:1,.d), add the following:
[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 users and assign permissions//Create operating system user#
Useradd quwenzhe #
Useradd Zhanghongjie #
Useradd RD //Modify the user's group#
Usermod-a-G RD Quwenzhe #
Usermod-a-G RD Zhanghongjie //Create Samba users#
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//testing on Linux#
Smbclient-l localhost-u [email protected]
Test on//windowsRun window input
\\192.168.24.244
pull the target file directly into the target folder for resource sharing8. Linux access to Samba server
smbclient//192.168.24.244/rddocs-u quwenzhe
to this, we completed the installation of the Samba server configuration, Windows access to the Samba server, Linux access to the Samba server operation, I hope that my explanation can help you progress.
CentOS Installation Configuration Samba server