centos7 smb服务配置

设备 : centos7 , 物理机win10系统

检查安装包

[root@localhost ~]# rpm -qa grep samba
samba-4.10.4-11.el7_8.x86_64
grep-2.20-3.el7.x86_64

建立目录并赋予权限

[ root@localhost ~]# mkdir /var/exchange
[ root@localhost ~]# mkdir /var/ j ishubu

[ root@localhost ~]# chomd 1777 /var/exchange
[ root@localhost ~]# chomd 775 /var/j ishubu

[ root@localhost ~]# 11 /var
drwxrwxrwt.2 root root 6 625 17 :25 exchange
rwxrwxr-x.2 root root 6 625 17:25 j ishubu

添加用户组

[ root@localhost ~]# groupadd j ishubu
[ root@localhost ~]# useradd -g j ishubu test1      #添加test1并加入j ishubu
[ root@localhost ~]# chgrp j ishubu /var/jishubu

修改配置服务


[ root@localhost ~]# vim /etc/samba/smb.conf
##添加建立的用户组的配置其他不用修改
[jishubu]
comment = jishubu`s file
path =/var/jishubu
public = yes 
write list = @jishubu

[exchange]
comment = Public Stuff
path = /var/exchange
public = yes
writeable = yes

语法检测

[ root@localhost ~]# testparm 

创建smb用户及密码

[root@localhost ~]# smbpasswd -a smbtest
New SMB password:
Retype new SMB password:
[root@localhost ~]# smbpasswd -a test1
New SMB password:
Retype new SMB password:

重启服务器,开始测试

[root@localhost ~]# service smb restart

win 10 开启sam服务
在这里插入图片描述
点开程序


在这里插入图片描述
测试
在这里插入图片描述
在这里插入图片描述

ok 结束

猜你喜欢

转载自blog.csdn.net/weixin_44332119/article/details/106982814