Linux基础教程学习笔记之Samba
配置Samba服务器:
yum -y install samba samba-client
vim /etc/samba/smb.conf
workgroup = STAFF
[smb1]
path = /smb1
3.mkdir /smb1
4.useradd harry; smbpasswd -a harry
5.systemctl enable smb nmb
systemctl start smb nmb
6.firewall –permanent –add-service=samba
7.chcon -R -t samba_share_t /smb1
8.semanage fcontext -a -t samba_share_t “/share(/.*)?”
9.restorecon -RFvv /share
第二道Samba题配置:
mkdir /smb1
chcon -R -t samba_share_t /smb2
setfacl -m u:ldapuser2:rwx /smb2
smbpasswd -a ldapuser2 (帐号不用创建)
vim /etc/samba/smb.conf
[smb2]
path = /smb2
valid users = ldapuser1 ldapuser2
write list = ldapuser2
6. systemctl restart smb nmb
7. vim /root/smb.passwd
username = ldapuser1
password = tianyun
8. vim /etc/fstab, 在desktop上
//server0/smb1 /mnt/smb1 cifs defaults, multiuser, sec=ntlmssp, credentials=/root/smb.passwd 0 0
9. su – ldapuser1
cifs add server0; cd /mnt/smb2; ls; /touch ttt
10. su – ldapuser2; cifscreds add server0
cd /mnt/smb2; ls; touch ttt
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-11/136648.htm