SMB server shared directory

Configure the SMB server on server0.

Requirements:
              
1. The samba server must be a member of the OBAMA work group.

2. Share the /common directory with the shared name common.

3. Only clients in the example.com domain are allowed to access common Share.

4. Common allows browsing.

5. Specify that the client natasha can read the file content, and the password to verify is: redhat. The






steps are as follows:




//1. You must install samba first, -y means yes no matter what he tells you.

yum -y install samba*




//2. After installation, restart smb nmb.

systemctl restart smb nmb




//3. Enable nmb

systemctl enable smb nmb





//4. Firewall related configuration

firewall-cmd --add-rich-rule 'rule family=ipv4 source address=172.16.30.0/24 service name=samba accept' --permanent
//client
firewall-cmd --add-rich-rule 'rule family=ipv4 source address=172.16.30.0/24 service name=samba-client accept' --permanent



//5. Reread the firewall configuration
firewall-cmd --reload


//6. Next, perform selinux related configuration.. If you enable selinux
//Check if there is a directory

getsebool -a | grep samba | grep dir
//Set the selinux directory of smb_home
setsebool -P samba_enable_home_dirs 1









//7. Create a shared directory common
mkdir /common




//8. If you want to share the samba directory to other users, you need to set:

chcon -Rt samba_share_t /common



//9. Configure Samba's configuration file

vim /etc/samba/smb.conf

workgroup = OBAMA //modified in line 89


[common]

path = /common // your shared location
browseable = yes //Can you browse
valid users = natasha //Related access user configuration Note: This guy must be in the system

:wq! //Save the configuration file to exit this fucker





//10. There is no such stupid user? you have to create a new one

id natasha //Is there? no....
useradd natasha //New creation is stupid
smbpasswd -a natasha //Create a new smb user






//11. Restart samba

systemctl restart smb nmb

pdbedit -L //Who are the users of the samba database? If not, please check whether the first steps are in place






Well, the configuration of the server ends here. The next article http://784838898.iteye.com/blog/2327621 is about configuring the SMB client. I wish you a successful exam...



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326485061&siteId=291194637