一、服务器配置
安装:yum install -y samba
更改要共享的path权限:chmod 777 /mnt/samba/
先备份smb.conf配置文件:cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
-
更改配置:vim /etc/samba/smb.conf
security = share
load printers = no
将[home]和[printer]部分注释掉
更改尾部的[public]如下
[samba]
comment= Public Stuff
path= /mnt/samba
public = yes
writable = yes
验证设置:testparm
关闭防火墙:service iptables stop
-
启动samba服务器:/etc/init.d/smb start
chkconfig smb on
SElinux部分设置:chcon -t samba_share_t /mnt/samba
二、Windows客户端访问
\\192.168.1.100,出现samba文件夹,可写入删除,映射为网络磁盘,OK
三、linux客户端访问及挂载
yum install -y samba-client
查看共享的目录:smbclient -L 192.168.1.100
挂载使用:mount -t cifs //192.168.1.100/samba /mnt/share -o username=root