首页 > 代码库 > samba 的多用户挂载

samba 的多用户挂载

我用两台虚拟机,一台server 一台client

在server上做如下设置:

  1. yum install -y samba samba-client

  2. firewall-cmd --permanent add-service=samba

  3. firewall-cmd --reload

  4. systemctl enable smb nmb

  5. mkdir /common mkdir /practice

  6. semanage fcontext -a -t samba_share_t "/common(/.*)?"

  7. semanage fcontest -a -t samba_share_t "/practice(/.*)?"

  8. restorecon /common   restore/common

  9. vim /etc/samba/smb.con

workgroup=sale

 [common]

 path = /common

 public = yes

 browseable = enable

 

 [practice]

 path = /practice

 public = yes

 writeable = yes

 write list= user1

 hosts allow = 10.128.1.0/32

10.useradd user1

    smbpasswd -a user1 

    passwd xxxxxx

11.vim /root/multi.user

    username=alice

    password=xxxxxx

12.vim /etc/fstab

    //server/practice /mnt/practice cifs defaults,cred=/root/multi.user,multiuser sec=ntlmssp 0 0 

13.systemctl restart smb nmb

14.mount -a 



samba 的多用户挂载