Arch Linux下配置Samba

时间:2022-09-06 18:55:13

本文记录笔者配置Samba的过程,供用于自用。

 

sudo pacman -S samba

 

sudo vim /etc/samba/smb.conf  添加以下内容

[global]
    dns proxy = No
    map to guest = Bad User
    netbios name = ARCH LINUX
    security = USER
    server string = Samba Server %v
    idmap config * : backend = tdb


[public]
    guest ok = Yes
    path = /home/samba/public
    read only = No


[private]
    path = /home/samba/private
    read only = No
    write list = @samba

 

sudo mkdir /home/samba

sudo mkdir /home/samba/shares

sudo mkdir /home/samba/privates

sudo chmod 777 /home/samba/shares

sudo chmod 777 /home/samba/privates

 

管理员登录:

groupadd smbgroup

useradd -g smbgroup samba

smbpasswd -a samba

 

sudo systemctl restart smbd

sudo systemctl enable smbd

注意:新版本samba的服务名变更为smb,所以以上两行命令要把smbd改为smb