前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOS中Samba配置后始终连不上解决

CentOS中Samba配置后始终连不上解决

作者头像
知忆
修改2021-06-11 10:02:05
2K0
修改2021-06-11 10:02:05
举报
文章被收录于专栏:linux百科小宇宙

按照网上的办法改了/etc/samba/smb.conf配置文件,结果在Win7里面就是连不上,后来发现是防火墙的问题。

有两个命令必须要执行:

1、将SELinux设置成disabled或者permissive

setenforce 0

2、关闭防火墙服务

service iptables stop

若SElinux啟用中,在Windows檔案總管無法連到 Samba 所分享出來的目錄時,

在Linux 中,可執行下列指令:

setsebool -P samba_enable_home_dirs on

參考文件: /etc/samba/smb.conf

#---------------

 # SELINUX NOTES:

 # 分享群組

# If you want to use the useradd/groupadd family of binaries please run:

 # setsebool -P samba_domain_controller on

 #

# 分享home目錄

# If you want to share home directories via samba please run:

 # setsebool -P samba_enable_home_dirs on

 #

 # If you create a new directory you want to share you should mark it as

 # "samba-share_t" so that selinux will let you write into it.

 # Make sure not to do that on system directories as they may already have

 # been marked with othe SELinux labels.

 #

 # Use ls -ldZ /path to see which context a directory has

 #

 # Set labels only on directories you created!

 # To set a label use the following: chcon -t samba_share_t /path

 #

# If you need to share a system created directory you can use one of the

 # following (read-only/read-write):

 # setsebool -P samba_export_all_ro on

 # o

 # setsebool -P samba_export_all_rw on

 #

 # If you want to run scripts (preexec/root prexec/print command/...) please

 # put them into the /var/lib/samba/scripts directory so that smbd will be

 # allowed to run them.

 # Make sure you COPY them and not MOVE them so that the right SELinux context

 # is applied, to check all is ok use restorecon -R -v /var/lib/samba/scripts

 #

 #--------------

 #

iptables开机自动启动:

开启: chkconfig iptables on 

关闭: chkconfig iptables off

iptables关闭服务:

开启: service iptables start 

关闭: service iptables stop

chkconfig --level 35 nmb on         

chkconfig --level 35 smb on       

------------------------------------分割线------------------------------------

如何在Ubuntu 14.04中使用Samba共享文件  http://www.linuxidc.com/Linux/2014-07/104894.htm

VMWare 虚拟机 Ubuntu 双网卡 访问 samba 速度 翻倍 http://www.linuxidc.com/Linux/2013-06/85445.htm

Samba文件共享服务器加入Windows Server 2003域 http://www.linuxidc.com/Linux/2013-06/86391.htm

Samba安装配置 http://www.linuxidc.com/Linux/2013-06/86101.htm

Ubuntu 15.04安装Samba服务 http://www.linuxidc.com/Linux/2016-03/129201.htm

CentOS 6.2 下Samba 服务的配置 http://www.linuxidc.com/Linux/2013-01/78390.htm

Samba服务器安装和配置  http://www.linuxidc.com/Linux/2014-12/110459.htm

CentOS部署Samba企业文件共享服务 http://www.linuxidc.com/Linux/2016-06/132609.htm

------------------------------------分割线------------------------------------

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档