window连接samba server,新建文件夹,显示无权限。
这种问题出现的原因是,服务器上的文件目录权限不全
需执行
[root@ /] # chmod 777 /share
[root@ /] # ll
drwxr-xr-x 2 root root 0 1月 6 14:49 share
# drwxr-xr-x 并不是全权限,说明执行成功
# 需要先行移除挂载和停止samba server
[root@ /]# df -h
//192.168.6.101/share 20G 4.1G 16G 21% /share
[root@ /]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
352229797a86 master2011/mysamba "/sbin/tini -- /usr/…" 59 minutes ago Up 47 minutes (healthy) 0.0.0.0:139->139/tcp, 137-138/udp, 0.0.0.0:445->445/tcp samba-test
# 停止
[root@ /]# docker stop samba-test
[root@ /]# umount -l //192.168.6.101/share /share
umount: /share:未挂载
# 赋予权限
[root@ /] # chmod 777 /share
[root@ /] # ll
drwxrwxrwx 3 root root 17 1月 6 14:20 share
# 重新启动和挂载、在挂载命令中要加 dir_mode=0777,file_mode=0777
[root@ /]# docker start samba-test
[root@ /]# mount -t cifs //192.168.6.101/share /share -o username=test,password='test@2.',domain=DOMAIN,vers=2.0,dir_mode=0777,file_mode=0777