关于vsftpd和smbd配置

这两个服务比较简单其实,如果在配置的时候selinux=disabled,那么就没有什么难度了。

当然如果配的时候smbd_disable_trans=on

ftpd_disable_trans=on 这样也没有什么难度。至于这样做对不对,我也不知道,但是个人觉得吧,

selinux自从开发出来以后,备受关注,各大linux发行版厂商都将selinux加进发行版里。可见selinux的重要性。

而且单单对于redhat而言,从AS4到AS5,他们将selinux的fcontext从13个增加到88个,可能以后还要增加,可见

selinux的重要性。

下面先简单地说一下关于vsftpd和smb的selinux:理解得不是很透,有待以后补充

关于ftp

  1.匿名用户上传:
    anon_upload_enable=YES
    anon_mkdir_write_enable=YES
  selinux设置:
    setsebool -P allow_ftpd_anon_write on
    mkdir /var/ftp/input
    chmod 777 /var/ftp/input
    chcon -t public_content_rw_t /var/ftp/input
    ls -Zd /var/ftp/input

  2.基于系统用户上传:
    setsebool -P ftp_home_dir on
    chroot_list_enable=YES
    chroot_list_file=/etc/vsftpd/chroot_list


关于smb:

匿名用户上传:
    1.# ls -dZ /samba-share/  
         drwxr-xr-x nobody nobody root:object_r:root_t /samba-share/  
      
    2.# chcon -R -t samba_share_t /samba-share/  
      
    3.# ls -dZ /samba-share/  
           drwxr-xr-x nobody nobody root:object_r:samba_share_t /samba-share/      
处理2:
                 1.# ls -dZ /samba-share/  
                          drwxr-xr-x  root root root:object_r:root_t             /samba-share/  
                       2 .# chcon -R -t public_content_rw_t /samba-share/  
                     3.# ls -dZ /samba-share/  
                      drwxr-xr-x  nobody nobody root:object_r:public_content_rw_t /samba-share/  


    
          註:public_content_t(讀)與public_content_rw_t(寫)是所有domain  

共同可以存取的檔案type,後者通常需要打開allow_xxx_anon_write項目的布林值,否則只具備讀的權限而已。      




# getsebool -a | grep allow_smbd_anon_write
allow_smbd_anon_write --> off
•开启这个允许匿名写入。
# setsebool -P allow_smbd_anon_write=1

转载于:https://www.cnblogs.com/linuxkernel/archive/2009/05/08/1854959.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值