1.SSH安全设置
1).ssh关闭root用户远程登录
#vim /etc/ssh/sshd_config
PermitRootLogin on
2).ssh限定用户只能使用密钥登陆,即禁用密码登陆 :PasswordAuthentication no
2.FTP安全设置
1)去掉用户的shell权限
#vim /etc/proftpd/proftpd.conf
RequireValidShell off 去掉注释
2)锁定用户的根目录只能在指定目录:
DefaultRoot ~sshuser (限定sshuser用户的根目录在指定的目录)
3)关闭ipv6功能:Useripv6 off
3.apache2 安全设置
1)隐藏apache的版本信息
#vim /etc/apache2/conf.d/sercurity
ServerSignature off
ServerTokens Prod
2)取消索引功能
#vim #vim /etc/apache2/sites-available/default
使用“-”注释掉Index,FollowSymLinks,MultiVIews
3.php安全设置
1)开启安全模式
#vim /etc/php5/apache2/php.ini
设置safe-mode on 其余的相关safe选项视需求而定
2)取消向客户端返回错误:disable-error=off (在测试成功后在设置为off)
3)记录出错日志:log-error=on error-log=filename
4)设置部分函数无效:disa-function=函数名
5)在http报头中隐藏php版本信息:expose_php off