一分鐘搭建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

相關文章
相關標籤/搜索