部署Samba服务

1.检查yum仓库,确保epel已经安装,yum install epel-release -y

yunm repolist all |grep enable

2.安装samba和samba软件包

yum -y install samba samba-client

3.创建共享目录mkdir /share

设置共享目录权限,复制etc下的passwd,group文件到share cp /etc/passwd /etc/group /share

图片[1]-部署Samba服务-晴天生活分享日志

ls /share

4.给共享目录权限chmod -R 777 /share

5.新建samba用户,新建三个samba用户,kitty、alice、jeven,其中kitty属于it组

groupadd it

useradd -g it kitty

useradd alice

useradd jeven

smbpasswd -a kitty

6.编辑samba主配置文件

备份/etc/samba/smb.conf   cp /etc/samba/smb.conf  /etc/samba/smb.conf.bak

在/etc/samba/smb.conf文件中,新增以下部分:

[share]       path = /share       browseable = yes       write list = @it,jeven       hosts allow = 192.168.3.0/24 

vim /etc/samba/smb.conf

7.重启samba服务

enable –now smb

enable ——————–now nmb

8.关闭防火墙放行samba服务

systemctl stop fierwalld && systemctl disable firewalld

放行samba服务 firewall-cmd –parmanent –add-service=sambafirewall-cmd –reload

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config setenforce 0

9.安装samba-client 相关软件包
yum -y install samba-client cifs-utils
创建samba认证用户文件smbur,使用alice作为认证用户
 echo "username=alice" >> /etc/samba/smbur.txt  echo "password=redhat" >> /etc/samba/smbur.txt 

10.创建挂载目录mkdir -p /samba/share
grep samba | /etc/fstab
mount -a
su -admin
ls

 

------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容