环境
系统:CentOS 6.8
服务端
-
安装
# yum install -y samba # chkconfig smb on
-
配置无密码登录
# vim /etc/samba/smb.conf [global] workgroup = WORKGROUP hosts allow = 127. 192.168. security = share [public] comment = Public path = /data/samba/public guest ok = yes read only = no
-
配置账号密码登录
vim /etc/samba/smb.conf [global] workgroup = WORKGROUP hosts allow = 127. 192.168. security = user passdb backend = tdbsam [ops] comment = ops data path = /data/samba/ops read only = no valid users = ops
# useradd ops # passwd ops # pdbedit -a ops # pdbedit -L
# chown -R ops:samba /data/samba/ops
-
检查配置
# testparm
-
启动
# /etc/init.d/smb restart
-
多用户权限设置
[global] ... create mask = 0644 force user = root force group = root ...
客户端
-
Windows
-
无密码登录
浏览器输入file://10.10.10.10/public
-
账号密码登录
浏览器输入file://10.10.10.10/ops
输入用户名和密码
-
-
Linux
-
无密码登陆
# mount -t cifs //10.10.10.10/public /mnt
-
账号密码登陆
# mount -t cifs //10.10.10.10/ops /mnt -o username=ops,password=123456
-
-
macOS
-
无密码登陆
Finder-->前往-->连接服务器
输入smb://10.10.10.10/public
-
账号密码登陆
Finder-->前往-->连接服务器
输入smb://10.10.10.10/ops
连接身份:注册用户,名称:ops
,密码:123456
-
网友评论