Manjaro搭建samba共享文件服务器
使用yay安装samba
yay -S samba
查看版本
samba -V
创建一个文件夹并设置权限
mkdir share
sudo chmod -R 777 share
创建配置文件
sudo vim /etc/samba/smb.conf
配置文件内容
[global]
workgroup = WORKGROUP
netbios name = SMBServer
server string = Samba Server
log file = /var/log/samba/%m.log
max log size = 100
security = user
# map to guest = Bad User
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = yes
domain master = yes
preferred master = yes
domain logons = yes
guest account = root
guest ok = yes
[share] # 对外看到的共享名称
# path:实际共享目录
# valid users:允许登录samba的用户名
comment = share
path = /home/zyy/share
available = yes
browseable = yes
writable = yes
public = yes
create mask = 0777
directory mask = 0777
valid users = zyy
检查配置文件是否有语法错误
testparm
将系统用户加入到samba用户,并设置密码
sudo smbpasswd -a zyy
启动samba服务
sudo systemctl start smb
查看服务状态
sudo systemctl status smb
windows右键此电脑>>映射网络驱动器>>输入\\服务器ip\share(对外看到的共享名称)