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

有两个命令必须要执行:

1、将SELIUNX设置成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
# or
# 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

centos中samba配置后始终连不上的绝招的更多相关文章

  1. Centos中如何配置Texlive2013中文字体的问题

    Centos中如何配置Texlive2013中文字体的问题: 第一步是下载你需要的字体,我从windows/fonts中拷贝的比较多,你只要复制你需要的字体即可. 注意只要文件扩展名为ttf的文件,t ...

  2. CentOS中安装配置Nginx

    一.安装Nginx '首先我们需要在nginx官网中下载nginx安装包,在这就下载最新版 nginx-1.13.7版本 下载完成以后我们进入下载页面进行查看 下载文件目录为 home/userNam ...

  3. f-stack中nginx配置后make出现error: ignoring return value of ‘ftruncate’

    问题 Nginx 配置后 make 出现error: src/os/unix/ngx_process_cycle.c: In function 'ngx_start_worker_processes' ...

  4. CentOs中iptables配置允许mysql远程访问

    在CentOS系统中防火墙默认是阻止3306端口的,我们要是想访问mysql数据库,我们需要这个端口,命令如下: 1 /sbin/iptables -I INPUT -p tcp --dport 30 ...

  5. CentOS中TFTP配置

    转载:http://www.centoscn.com/image-text/config/2013/1105/2062.html TFTP是用来下载远程文件的最简单网络协议,它其于UDP协议而实现 1 ...

  6. centos中安装配置nginx完成之后主机无法访问

    原因 VMware中安装centos7,安装配置完成nginx后,主机无法访问.虚拟机没有放行Nginx默认端口80. 解决办法 首先:开启 web 端口 firewall-cmd --permane ...

  7. 一起了解下Centos中‘vim配置’有多强大?

    在linux的系统上安装vim编辑器后,发现vim的页面设置还是不太习惯,没有显示的行号,也没有自动的缩进,页面的背景也不是很好看,但是vim编辑器是可以进行配置的,我们可以打造属于自己的vim风格. ...

  8. CentOS下samba配置心得(smb和nmb都要启动)

    印象中以前多次配置成功过,重新配置就把以前的资料找出来: yum安装 samba samba-client samba-swat,然后配置参见:http://www.cnblogs.com/mchin ...

  9. CentOS 7 samba 配置

    1.安装samba sudo yum install samba 2.环境配置 a.关闭防火墙 sudo systemctl stop firewalld.service #停止firewallsud ...

随机推荐

  1. (转载)OC学习篇之---类的定义

    之前已经介绍了OC中的一个程序HelloWorld,今天我们继续学习OC中类的相关知识. OC和C的最大区别就是具有了面向对象的功能,那么说到面向对象,就不得不说类这个概念了,如果学过Java的话,那 ...

  2. css 超出部分显示省略号

    代码: overflow: hidden; white-space: nowrap;  text-overflow: ellipsis; 重点代码:text-overflow: ellipsis; 解 ...

  3. JAVA与图形界面开发(Applet应用程序、AWT库、Swing)

    Applet 1)简单说,Applet就是嵌入到网页中的小程序,Java代码. 2)编写Applet程序,要继承JApplet类,并根据自己需要覆写相关方法(init.start.stop.destr ...

  4. POJ-1002 解题报告

      1.题目描述 http://poj.org/problem?id=1002 2.解题过程 按部就班来解题的话,这个题目很容易写出来,这是我的第一个版本的代码,思路是读入一行电话字符串,均转化为整型 ...

  5. EasyMock(官方资料整理)

    1.要求 EasyMock要求java1.5.0及以上版本. Objenesis (2.0+)必须在classpath中来执行class mocking. 2.使用Maven 在Maven中心库中可以 ...

  6. SQL入门

    ​ # SQL入门 数据库表 一个数据库(database)通常包含一个或多个表(table). 每一个表都有一个名字标识. 表单包含数据的记录(行). 一些重要的SQL命令(常用的吧) 命令 说明 ...

  7. mongodb 新建用户 -摘自网络

    随着版本的更新,对在使用mongodb的业务也进行了版本升级,但是在drop掉一个数据库时,问题来了,原来的用户随着删除库也被删除掉,但是再想通过原来的语法db.addUser()添加,一直报错,提示 ...

  8. elisp debug

    M-x  是运行command的意思. 若使用常规Emacs debugger(即不使用edebuger),先把要debug的函数加入到debug-on-entry:  M-x   debug-on- ...

  9. HDU 5781 ATM Mechine (概率DP)

    ATM Mechine 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5781 Description Alice is going to take ...

  10. json网页预览插件