查看是否安装
ps –qa|grep samba
安装samba
yum –y install samba
创建samba共享用户
groupadd samba –g 6000
useradd samba -u 6000 -g 6000 -s /sbin/nologin -d /dev/null
创建共享目录:
mkdir /home/samba
配置访问权限
chown -R samba:samba samba/
到smb.conf配置文件目录
cd /etc/samba/
//编辑配置文件
vi smb.conf
[global]
workgroup =WORKGROUP
server string = SambaServer %v
security = user
dns proxy = no
hosts allow = 127.192.168.3.
[samba-file]
comment = samba-file
path = /home/samba
browsable = yes
writeable = yes
valid users = samba
public = yes
read only = no
//启动samba
systemctl start nmb smb
客户端:
安装samba客户端:
yum install samba-client
yum install cifs-utils
创建共享目录
mkdir /home/samba
挂载共享目录
mount -t cifs //192.168.3.12/samba-file /home/samba/ -ousername=samba,password=samba