1.创建本地yum源,(略。前面文章有写vi /etc/yum.repos.d/local.repo)
#name:自定一个名称
#baseurl:挂载镜像路径(本地yum源路径地址)
#enable:本地yum源启动开关(启动1 或 禁用0)
#gpgcheck:检查GPG-KEY
(检查1 (需在下行增加gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6),不检查0,省略)
2.安装Samba软件,(yum -y install samba)
3.配置samba文件,vi /etc/samba/smb.conf
#[global]:全局配置
#[share136]:共享名称定义
#path:share路径
#browseable:允许浏览
#guest ok:访客访问
#writeable:允许写入
#public:允许所有人访问权限
此配置为<security=share>模式,所有人都可以匿名访问无需账号密码
*配置完成后记得重启smb服务(service smb restart)
4.共享文件夹目录属性修改(rwx读写执行w=4,r=2,x=1)
# chmod 777 share/
# chown -R root:root share/ (设置share/目录的所有者root和组root)
5.开启smb/nmb和停用iptables/selinux相关服务
设置开机自动启动smb.service、nmb.service
# chkconfig smb on
# chkconfig nmb on
设置开机自动关闭防火墙iptables.service
# chkconfig iptables off
修改设置selinux 为关闭状态
# SELINUX=disabled(vi /etc/selinux/config)
chkconfig 的设置reboot Linux之后生效
service smb start / stop(临时开启/关闭smb服务,service smb restart后生效,重启Linux之后失效)
以上所有配置完成之后,就可以开始匿名访问//share136共享目录
<security=user>模式:
可设置白名单:valid users =
黑名单:invalid users =
访问共享IP白名单:allow hosts =
黑名单:deny hosts =
只读开关:read only = yes / no
。。。