前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Samba3.X-Swat配置

Samba3.X-Swat配置

作者头像
py3study
发布2020-01-03 14:39:59
6480
发布2020-01-03 14:39:59
举报
文章被收录于专栏:python3python3

第一步:关闭Selinux

[root@localhost ~]# vi /etc/selinux/config

代码语言:javascript
复制
 # This file controls the state of SELinux on the system.  # SELINUX= can take one of these three values:  #     enforcing - SELinux security policy is enforced.  #     permissive - SELinux prints warnings instead of enforcing.  #     disabled - No SELinux policy is loaded.  SELINUX=enforcing #这里改成disabled  # SELINUXTYPE= can take one of these two values:  #     targeted - Targeted processes are protected,  #     mls - Multi Level Security protection.  SELINUXTYPE=targeted 

注:这里我只不过把它全整个关掉,samba中如何设置Selinux参见:http://fedoraproject.org/wiki/SELinux/samba

第二步:安装Samba及Swat

[root@localhost ~]# yum install -y samba-*

[root@localhost ~]# rpm -qa|awk '/samba/' 

代码语言:javascript
复制
samba-winbind-clients-3.5.10-115.el6_2.x86_64  samba-swat-3.5.10-115.el6_2.x86_64 #SWAT包也安装成功了  samba-3.5.10-115.el6_2.x86_64  samba-domainjoin-gui-3.5.10-115.el6_2.x86_64  samba-winbind-devel-3.5.10-115.el6_2.x86_64  samba-common-3.5.10-115.el6_2.x86_64  samba-winbind-3.5.10-115.el6_2.x86_64  samba-doc-3.5.10-115.el6_2.x86_64  samba-client-3.5.10-115.el6_2.x86_64  samba-winbind-krb5-locator-3.5.10-115.el6_2.x86_64 

[root@localhost ~]# yum install xinetd* #安装它是通过xine服务来启动SWAT

[root@localhost ~]# vi /etc/xinetd.d/swat

代码语言:javascript
复制
# default: off  # description: SWAT is the Samba Web Admin Tool. Use swat \  #              to configure your Samba server. To use SWAT, \  #              connect to port 901 with your favorite web browser.  service swat  {          port            = 901         socket_type     = stream         wait            = no           only_from       = 0.0.0.0 #默认是127.0.0.1          user            = root         server          = /usr/sbin/swat          log_on_failure  += USERID          disable         = no #默认是YES  } 

[root@localhost ~]# service xinetd restart #重启xinetd,并启动Swat服务

[root@localhost ~]# netstat -lnpt|awk '/901/' #查检901端口是否开放

代码语言:javascript
复制
tcp        0      0 :::901                      :::*                        LISTEN      9880/xinetd     

第三步:登录SWAT (切记:iptables里面开放901或关闭iptables)

输入你的IP加901端口号,登录帐号是ROOT出现如下界面证明你配置成功了。

[root@localhost ~]# useradd smbuser #创建用户

[root@localhost ~]# smbpasswd -a smbuser #提升用户

[root@localhost ~]# mkdir /usr/local/share_dir #创建共享目录

[root@localhost ~]# chown smbuser:smbuser -R /usr/local/share_dir/ #设置权限

创建共享目录

设置共享目录

 设置完成以后需要重起Samba服务

第四步:Samba调式讲解

1:smbpasswd 命令创建的用户数据存在哪儿

答:[root@localhost ~]# smbd -b | grep PRIVATE_DIR    PRIVATE_DIR: /var/lib/samba/private

2:Samba的主配置文件smb.conf在哪儿

答:[root@localhost ~]# smbd -b | grep smb.conf    CONFIGFILE: /etc/samba/smb.conf

3:Samba如何检查配置是否正确

答:[root@localhost ~]# testparm -s /etc/samba/smb.conf

Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Processing section "[homes]" Processing section "[printers]" Loaded services file OK. Server role: ROLE_STANDALONE [global]         workgroup = MYGROUP         server string = Samba Server Version %v         log file = /var/log/samba/log.%m         max log size = 50         cups options = raw

[homes]         comment = Home Directories         read only = No         browseable = No

[printers]         comment = All Printers         path = /var/spool/samba         printable = Yes         browseable = No

参考文档

http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/

http://www.samba.org/samba/docs/man/Samba-Guide/

http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019/09/23 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

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

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

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