samba多用户

注意的点

1:安装

服务器  yum install -y samba*

客户端  yum install -y samba-client  cifs-utils

服务器端和客户端网络能ping通

2:服务器创建samba目录和目录设置

mkdir /common

chmod o+rwx /common(尽量采用setfacl)

3:服务器防火墙和selinux设置

服务器  添加samba服务,添加139 445端口

firewalld-cmd --permant --add-service=samba

firewalld-cmd --permant --add-port=139/tcp

firewalld-cmd --permant --add-port=139/udp

firewalld-cmd --permant --add-port=445/tcp

firewalld-cmd --permant --add-port=445/udp

firewalld-cmd --reload

setsebool -P samba_enable_home.. =on

setsebool -P samba_export_rw on

chcon -t samba_share_t /common

4.在客户端挂载

普通挂载方式

mount -o multiuser,user=user1,sec=ntlmssp //192.168.100.1/common /common

mount挂载方式

echo user=user1 >> /userfile.txt

echo pass=admin >> /userfile.txt

vim /etc/fstable

//192.168.100.1/common  /common  cifs  defaults,multiuser,credentials=/userfile.txt,sec=ntlmssp  0  0

:wq

事例当中的user1必须在服务器有此用户,才能使用多用户挂载。

mount -a

5:客户端查看效果

可以su到user1查看

cifscreds add 192.168.100.1     获取user1的权限

ll /common

原文地址:https://www.cnblogs.com/xuekun/p/8669754.html