项目场景:
因为要上传本地瓦片100gb左右,下载再上传时间太长了,最后想到直接下载在服务器,但是下载瓦片软件没有linux版本,于是想到共享文件夹
问题描述
按照这个大佬文档(linux+samba配置)一切都还好,查看复制都可以,但是不能新增文件夹文件:
配置
sudo nano /etc/samba/smb.conf# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.[global]workgroup = SAMBAsecurity = userpassdb backend = tdbsamprinting = cupsprintcap name = cupsload printers = yescups options = raw[homes]comment = Home Directoriesvalid users = %S, %D%w%Sbrowseable = Noread only = Noinherit acls = Yes[printers]comment = All Printerspath = /var/tmpprintable = Yescreate mask = 0600browseable = No[print$]comment = Printer Driverspath = /var/lib/samba/driverswrite list = @printadmin rootforce group = @printadmincreate mask = 0664directory mask = 0775
[gis]
public = yes
path = /home/gis-data/
writable = yes
browseable = yes
guest ok = yes
security = share
read only = no
create mask = 0777
directory mask = 0777
available = yes
write list = root,administrator,gluu
原因分析+解决方案:
怎么测试都不行还是以为配置写错了,最后试试SELinux关闭解决了,原来是SELinux问题
最后抱着试试看的心态关闭了SELinux
竟然可以了(网上有配置SELinux并且开启samb的文件可以看看,本人不太会使用关闭这简单版本)
enforcong:执行中
permissive:不执行但产生警告
diasbled:关闭
- 临时关闭:setenforce 0 不需要重启,重启后失效
- 永久关闭:sed -i s#SELINUX=enforcing#SELINUX=disabled# /etc/selinux/config 需要重启