作家
登录

15步打造一个安全的Linux服务器

作者: 来源: 2017-05-24 16:06:21 阅读 我要评论

  • #chmod og-rwx /etc/crontab  
  •   
  •  
  • #chown root:root /etc/cron.hourly  
  •   
  •  
  • #chmod og-rwx /etc/cron.hourly  
  •   
  •  
  • #chown root:root /etc/cron.daily  
  •   
  •  
  • #chmod og-rwx /etc/cron.daily  
  •   
  •  
  • #chown root:root /etc/cron.weekly  
  •   
  •  
  • #chmod og-rwx /etc/cron.weekly  
  •   
  •  
  • #chown root:root /etc/cron.monthly  
  •   
  •  
  • #chmod og-rwx /etc/cron.monthly  
  •   
  •  
  • #chown root:root /etc/cron.d  
  •   
  •  
  • #chmod og-rwx /etc/cron.d 
  • 为/var/spool/cron分派恰当的权限:

    1. #chown root:root <crontabfile> 
    2. #chmod og-rwx <crontabfile> 

    为“passwd”、“group”、“shadow”和“gshadow”文件分派恰当的权限:

    1. #chmod 644 /etc/passwd    
    2.  
    3. #chown root:root /etc/passwd   
    4.  
    5. #chmod 644 /etc/group   
    6.  
    7. #chown root:root /etc/group   
    8.  
    9. #chmod 600 /etc/shadow   
    10.  
    11. #chown root:root /etc/shadow   
    12.  
    13. #chmod 600 /etc/gshadow   
    14.  
    15. #chown root:root /etc/gshadow 

    15-额外的操作

    接下来,将下图所示的最后一行数据添加进去。

    除了上述设备之外,下面这些身分也应当纳入我们的┞峰酌范围内。

    第一:

    -在/etc/security/limits.conf文件中添加“hardcore 0”;-在/etc/sysctl.conf文件中添加“fs.suid_dumpable= 0”;

    第二:

    -在/etc/sysctl.conf文件中添加“kernel.exec-shield= 1”

    保护Linux主机的收集晃荡同样是异常重要的,永远不要指望着防火墙去帮你完成所有的义务。打开/etc/sysctl.conf文件,然落后行下列设置:

    13-暗码策略

    -在/etc/sysctl.conf文件中添加“kernel.randomize_va_space= 2”;

    停止语

    在这篇文┞仿中,我给大年夜家介绍了几个可以或许加强Linux体系安然性的重要设备。

    【编辑推荐】

    1. 完全指南:如安在CentOS 7中安装、设备和安然加固FTP办事
    2. 一个可以查看Linux当前缓存了哪些大年夜文件的小对象
    3. 老司机浅谈linux体系进修技能
    4. 大年夜蓝瘦“想哭”到 SELinux 看操作体系安然安在
    5. 切切切切不要运行的Linux敕令
    【义务编辑:枯木 TEL:(010)68476606】

      推荐阅读

      Javascript深拷贝

    有时刻保存了dom元素, 一不当心进行深拷贝,膳绫擎的深拷贝函数就缺乏了对Element元素的断定。而断定Element元素要应用instanceof来断定。因为对于不合的标签,tostring会返回对应不合的标签的构造函数。 >>>详细阅读


    本文标题:15步打造一个安全的Linux服务器

    地址:http://www.17bianji.com/lsqh/35402.html

    关键词: 探索发现

    乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

    网友点评
    自媒体专栏

    评论

    热度

    精彩导读
    栏目ID=71的表不存在(操作类型=0)