Gentoo 上配置 Samba

安装 Samba

1
2
3
4
5
6
# /usr/portage/package.use 配置 USE
# samba
net-fs/samba -cups -client -system-mitkrb5 # 移除域控和不必要的依赖
sys-libs/ldb -ldap # 移除域控
# Install Samba
emerge --ask --noreplace net-fs/samba

配置 Samba

创建要共享的 Samba 目录并配置 smb.conf

1
2
3
4
5
6
7
8
9
10
11
# /etc/samba/smb.conf
[anime]
path = /data/bt/downloads
public = yes
writable = yes
valid users = ${USER} # 替换成对应用户
create mask = 0644
force create mode = 0644
directory mask = 0755
force directory mode = 0755
available = yes

创建 Samba 用户密码

1
smbpasswd -a $USER

启动 Samba

1
2
3
# systemd
systemctl enable smb.service
systemctl start smb.service

参考资料