2021-05-12 14:32:11
Linux基礎教學學習筆記之Samba
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
相關文章