samba搭建用户认证共享服务器

搭建用户认证共享服务器

1.准备工作

环境

ip 主机 环境
172.16.30.30 system2 redhat7图形界面
172.16.30.130 system1 redhat7图形界面

2.服务端

关防火墙和selinux。安装samba服务

[root@system2 Desktop]# systemctl stop firewalld.service 
[root@system2 Desktop]# setenforce 0
[root@system2 Desktop]# yum -y install samba-*
[root@system2 Desktop]# useradd -M jianghu
[root@system2 Desktop]# smbpasswd -a jianghu
New SMB password:
Retype new SMB password:
Added user jianghu.
[root@system2 Desktop]# echo 'jianghu = share' > /etc/samba/smbusers
[root@system2 Desktop]# vim /etc/samba/smb.conf 
[root@system2 Desktop]# mkdir -p /hupu/jianghu
[root@system2 Desktop]# chown -R jianghu.jianghu /hupu/jianghu/
[root@system2 Desktop]# ll /hupu/
total 0
drwxr-xr-x. 2 jianghu jianghu 6 Jan 15 09:43 jianghu
[root@system2 Desktop]# cat >> /etc/samba/smb.conf <<EOF
> [jianghu]
> comment = jianghu
> path = /hupu/jianghu
> browseable = yes
> guest ok = yes
> writable = yes
> write list = share
> public = yes
> EOF
[root@system2 Desktop]# tail -8 /etc/sa
samba/  sane.d/ sasl2/  
[root@system2 Desktop]# tail -8 /etc/samba/smb.conf 
[jianghu]
comment = jianghu
path = /hupu/jianghu
browseable = yes
guest ok = yes
writable = yes
write list = share
public = yes
[root@system2 Desktop]# systemctl start smb
[root@system2 Desktop]# systemctl restart smb
[root@system2 Desktop]# systemctl reload smb
[root@system2 Desktop]# systemctl enable smb
ln -s '/usr/lib/systemd/system/smb.service' '/etc/systemd/system/multi-user.target.wants/smb.service'

3.客户端验证

[root@system1 Desktop]# smbclient -L 172.16.30.30 -U share
Enter share's password: 
Domain=[SAM
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值