手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Samba3.X-Swat配置

[日期:2012-04-13] 来源:Linux社区  作者:skyson [字体:大 中 小]
第一步:关闭Selinux
[root@localhost ~]# vi /etc/selinux/config
 
  1.  
  2. # This file controls the state of SELinux on the system.  
  3. # SELINUX= can take one of these three values:  
  4. #     enforcing - SELinux security policy is enforced.  
  5. #     permissive - SELinux prints warnings instead of enforcing.  
  6. #     disabled - No SELinux policy is loaded.  
  7. SELINUX=enforcing #这里改成disabled  
  8. # SELINUXTYPE= can take one of these two values:  
  9. #     targeted - Targeted processes are protected,  
  10. #     mls - Multi Level Security protection.  
  11. SELINUXTYPE=targeted 

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

第二步:安装Samba及Swat

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

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

  1. samba-winbind-clients-3.5.10-115.el6_2.x86_64  
  2. samba-swat-3.5.10-115.el6_2.x86_64 #SWAT包也安装成功了  
  3. samba-3.5.10-115.el6_2.x86_64  
  4. samba-domainjoin-gui-3.5.10-115.el6_2.x86_64  
  5. samba-winbind-devel-3.5.10-115.el6_2.x86_64  
  6. samba-common-3.5.10-115.el6_2.x86_64  
  7. samba-winbind-3.5.10-115.el6_2.x86_64  
  8. samba-doc-3.5.10-115.el6_2.x86_64  
  9. samba-client-3.5.10-115.el6_2.x86_64  
  10. 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

  1. # default: off  
  2. # description: SWAT is the Samba Web Admin Tool. Use swat \  
  3. #              to configure your Samba server. To use SWAT, \  
  4. #              connect to port 901 with your favorite web browser.  
  5. service swat  
  6. {  
  7.         port            = 901 
  8.         socket_type     = stream 
  9.         wait            = no   
  10.         only_from       = 0.0.0.0 #默认是127.0.0.1  
  11.         user            = root 
  12.         server          = /usr/sbin/swat  
  13.         log_on_failure  += USERID  
  14.         disable         = no #默认是YES  
  15. } 

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

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

  1. 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

linux
相关资讯       samba 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款