安装samba
sudo apt install samba
编辑配置文件
sudo vim /etc/samba/smb.conf
在末尾加入:
[echohye] #smb 用户
path = /home/echohye/共享文件夹 #共享路径
available = yes
writeable = yes
security = share
browseable = yes
guest ok = yes
force user = echohye #Ubuntu用户名
添加smb用户
sudo useradd echohye #如果echohye用户名不存在
sudo smbpasswd -a echohye
**** #password
重启服务
sudo /etc/init.d/smbd restart
然后再windows上映射磁盘就行了
一开始在smb.cnf中没有添加force user = echohye
,导致windows 映射磁盘时一直提示无权限。
查看 samba 日志
echohye@ubuntu:/var/log/samba
echohye@ubuntu:tail -f log.laptop-s0eg824r
chdir_current_service: vfs_ChDir(/home/echohye/公共的/共享文件夹) failed: 权限不够. Current token: uid=65534, gid=65534, 1 groups: 65534
[2023/04/22 10:23:24.181604, 0] ../../source3/smbd/service.c:168(chdir_current_service)
chdir_current_service: vfs_ChDir(/home/echohye/公共的/共享文件夹) failed: 权限不够. Current token: uid=65534, gid=65534, 1 groups: 65534
标签:samba,echohye,windows,sudo,文件夹,ubuntu,65534,共享
From: https://www.cnblogs.com/echohye/p/17342629.html