CentOS 简单设置samba服务

1、安装

  yum -y install samba

2、设置配置文件

  1) 备份Samba的配置文件:cp  /etc/samba/smb.conf  /etc/samba/smb.conf.bak

  2) 在/etc/samba/smb.conf文件的末尾之添加如下字段:

[koorey]
comment = koorey
path = /home/koorey
writable = yes

  3) 向samba里面添加用户

  smbpasswd  -a   koorey  #添加用户koorey到Samba用户数据库中

3、重启samba

  service smb restart

4、关闭 iptables和selinux

  1) 在对待iptables的问题上:

  普通青年:直接在命令行敲…
  service iptables stop。
  文艺青年:依次在命令行敲…
  iptables -I RH-Firewall-1-INPUT 5 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
  iptables -I RH-Firewall-1-INPUT 5 -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
  iptables -I RH-Firewall-1-INPUT 5 -p udp -m udp --dport 137 -j ACCEPT
  iptables -I RH-Firewall-1-INPUT 5 -p udp -m udp --dport 138-j ACCEPT
  iptables-save
  service iptables restart
  2)同样,在对在selinux的问题上:(这丫的把我坑惨了呀)
  普通青年:直接在命令行敲…
  setenforce 0
  vi /etc/selinux/config
  将SELINUX=enforcing改为SELINUX=disabled为开机重启后不再执行setenfore节约光阴。
  文艺青年:依次在命令行敲…
  setsebool -Psamba_enable_home_dirs on
  setsebool -Psamba_export_all_rw on
  完事儿之后再:getsebool -a | grep samba一把,你懂得…

来源:http://blog.chinaunix.net/uid-23069658-id-3142052.html

原文地址:https://www.cnblogs.com/fengbohello/p/5036119.html