SMB服务端共享目录

在server0上配置SMB服务端.

要求条件:
              
1.samba服务器必须得是OBAMA工作组的一员.

2.共享/common目录,共享名称为common.

3.只有example.com域的客户端准许访问common共享.

4.common允许浏览.

5.指定客户natasha能够读取文件内容,并且要验证密码为:redhat.






步骤如下:




//1.你必须先安装桑巴,-y代表不管他告诉你什么你都yes.

yum -y install samba*




//2.安装完毕,重启smb nmb.

systemctl restart smb nmb




//3.启用nmb

systemctl enable smb nmb





//4.防火墙相关配置

firewall-cmd --add-rich-rule 'rule family=ipv4 source address=172.16.30.0/24 service name=samba accept' --permanent
//客户端
firewall-cmd --add-rich-rule 'rule family=ipv4 source address=172.16.30.0/24 service name=samba-client accept' --permanent



//5.重新读取防火墙配置
firewall-cmd --reload


//6.接下来进行selinux相关配置..如果你启用selinux的话
//查看有没有存在目录

getsebool -a | grep samba | grep dir
//设置smb_home的selinux目录
setsebool -P  samba_enable_home_dirs 1









//7.创建共享目录common
mkdir /common




//8.如果你希望将samba目录共享给其他用户,你需要设置:

chcon -Rt samba_share_t /common



//9.配置桑巴的配置文件

vim /etc/samba/smb.conf

workgroup = OBAMA   //在89行中修改


[common]

path = /common          //您共享的位置
browseable = yes        //可以浏览吗
valid users = natasha  //相关访问用户配置注意:系统中要有这个家伙

:wq!                              //保存退出这个操蛋的配置文件





//10.没有那他傻用户?你还得新建一个

id natasha                           //有么?没有....
useradd natasha                 //新建那他傻
smbpasswd -a natasha      //新建smb用户






//11.重启桑巴

systemctl restart smb nmb

pdbedit -L   //查看samba数据库用户都有谁?如果没那她傻 请检查前几步是否到位






好了 ,  服务端的配置到此为止  下一篇 http://784838898.iteye.com/blog/2327621关于配置SMB客户端                                 祝考试顺利...



猜你喜欢

转载自784838898.iteye.com/blog/2327610