一分钟搭建samba服务

运行yum install -y samba安装samba.linux

一. 建立linux用户

groupadd smbshare
useradd -g smbshare share
passwd sharevim

二. 建立samba用户

smbpasswd -a sharemarkdown

三. 建立目录

mkdir /home/smbshare
chgrp -R smbshare /home/smbshare
chmod g+w smbshare/spa

四. 修改配置文件

cp /etc/samba/smb.conf /etc/samba/smb.confbakrest

vim /etc/samba/smb.confcode

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
        workgroup = SAMBA
        security = user
        map to guest = Bad User
        log file = /var/log/samba/log.%m

[shares]
        comment = share
        path = /home/smbshare
 # 表示用户组
        valid users = @smbshare
        read only = No

复制代码

五.重启samba服务

systemctl restart smborm

六. 登陆

访问\\192.168.1.202\shares地址string

使用share/share用户名/密码登陆it

相关文章
相关标签/搜索