首页 > 代码库 > samba 的多用户挂载
samba 的多用户挂载
我用两台虚拟机,一台server 一台client
在server上做如下设置:
yum install -y samba samba-client
firewall-cmd --permanent add-service=samba
firewall-cmd --reload
systemctl enable smb nmb
mkdir /common mkdir /practice
semanage fcontext -a -t samba_share_t "/common(/.*)?"
semanage fcontest -a -t samba_share_t "/practice(/.*)?"
restorecon /common restore/common
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 的多用户挂载