V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ithelloworld
V2EX  ›  程序员

一台新的VPS,搭建了LAMP环境,如何做最基本的安全设置?

  •  
  •   ithelloworld · 2013-05-24 09:56:59 +08:00 · 4006 次点击
    这是一个创建于 3983 天前的主题,其中的信息可能已经有所发展或是发生改变。
    CentOS 6 + Apache + MySQL + PHP

    最简单实用的安全设置怎么做?

    当然用软件也好,如nagios。不用那个,手动配置呢?
    9 条回复    1970-01-01 08:00:00 +08:00
    AstroProfundis
        1
    AstroProfundis  
       2013-05-24 10:36:36 +08:00   ❤️ 4
    ssh 改到非标准端口,禁用密码登录只用密钥,装fail2ban,装iptables
    常用的基本手段大概就这些了吧...反正我只用了这些,个人用也不需要搞得多复杂,太麻烦了...
    crazybubble
        2
    crazybubble  
       2013-05-24 11:08:15 +08:00   ❤️ 4
    你可以看一下这篇文章 前阵子Hacker News上看到的:
    http://plusbryan.com/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers
    rhwood
        3
    rhwood  
       2013-05-24 11:19:05 +08:00   ❤️ 2
    一般是这样的。
    1 改ssh端口,设置其他2台机器可以密钥登录,然后把这个vps的ssh密码登录关了。
    2 lamp环境下装mod_security,可以用现成的安全规则比如 GotRoot
    3 该用的服务都装好后,在投入生产前装csf防火墙,csf比较傻瓜或者人性化,装好了,它会把listen的端口自动加到配置文件里允许打开的端口,其他不用的端口就关了,lfd还可以防止暴力破解
    molinxx
        4
    molinxx  
       2013-05-24 11:21:49 +08:00 via Android   ❤️ 1
    根据常见的网络攻击合理设置Apache参数,有条件可以上CDN
    ithelloworld
        5
    ithelloworld  
    OP
       2013-05-24 11:31:08 +08:00
    @AstroProfundis
    @crazybubble
    @rhwood
    @molinxx
    谢谢回答!很好的参考。
    wtbhk
        6
    wtbhk  
       2013-05-24 12:08:03 +08:00
    Mark
    marchtea
        7
    marchtea  
       2013-05-24 12:51:33 +08:00
    mark
    ithelloworld
        8
    ithelloworld  
    OP
       2013-05-24 13:00:58 +08:00   ❤️ 1
    又得知一个软件:ModSecurity

    让mark此主题的人多获取有用的东西吧,让此主题成为wiki!
    ithelloworld
        9
    ithelloworld  
    OP
       2013-05-24 15:03:35 +08:00
    linode的关于安全的文档:https://library.linode.com/security/basics
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5196 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 07:14 · PVG 15:14 · LAX 00:14 · JFK 03:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.