windows无法访问虚拟机linux里samba服务器

windows无法访问虚拟机linux里samba服务器,第1张

更改共享目录的context值,或者禁掉SELinux。
[root@localhost ~]# chcon  -t  samba_share_t  /companydata/tech  -R
或者:
[root@localhost ~]# getenforce 
Enforcing
[root@localhost ~]# setenforce Permissive
6)设置防火墙,允许通过,这一步很重要。
[root@localhost ~]# firewall-cmd --permanent --add-service=samba
success
[root@localhost ~]# firewall-cmd  --reload
success
[root@localhost ~]# firewall-cmd  --list-all

上面两步都做过了,就是windows系统一直访问不了samba共享的文件夹

最后,问题居然是修改Samba主配置文件(/etc/samba/smb.conf)出问题了,
里面不能有//的注释,把注释去掉就可以了


[root@localhost ~]# vim /etc/samba/smb.conf
[global]
        workgroup = SAMBA
        security = user               //默认user安全级别模式,默认值
        passdb backend = tdbsam
        printing = cups
        printcap name = cups
        load printers = yes
        cups options = raw
[tech]                              //设置共享目录的共享名为tech
        comment=tech
        path = /companydata/tech      //设置共享目录的绝对路径
        writable = yes
        browseable = yes
        valid users = @group-tech     //设置可以访问的用户为group-tech组
"/etc/samba/smb.conf" 43L, 814C 已写

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/2990368.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-09-23
下一篇2022-09-23

发表评论

登录后才能评论

评论列表(0条)

    保存