首页 > 系统服务 > 详细

Linux Server 安全相关设置

时间:2014-04-02 14:27:55      阅读:580      评论:0      收藏:0      [点我收藏+]

1. 修改默认端口,虽说ssh相对于telnet来讲,保密工作已经做的很好了,但是我个人还是习惯修改其    默认端口,并且限制远程ssh直接通过root帐号接入主机,给自己的主机增加一些安全筹码:


vim /etc/ssh/sshd_config         ====修改ssh配置文件
port 10002                       ====修改默认端口
PermitRootLogin no               ====限制远程直接通过root帐号ssh接入主机
vim /etc/sysconfig/iptables                    
-A INPUT -p tcp -m state --state NEW -m tcp --dport 10002 -j ACCEPT
or
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
/etc/init.d/iptables save

  注:端口修改完了要加入到iptables里面,否则仍是不能登录。iptables修改方法有两种,都行。

      不过方法二,要记得额外保存。


2. 防止主机中过多的帐号有切换至root的权限。  


vim /etc/pam.d/su                           ===修改su认证配置文件
auth sufficient pam_wheel.so trust use_uid  ===不需要root密码直接切换
auth required   pam_wheel.so use_uid        ===需要root密码才能切换
useradd hpfan                               ===创建user帐号
passwd hpfan                                ===创建user帐号密码
usermod -G 10 hpfan                         ===user帐号加入wheel组
cat/etc/group/|grep wheel              ===只有wheel组成员才能切换至root




本文出自 “要将技术进行到底” 博客,请务必保留此出处http://hpfan.blog.51cto.com/7707969/1388905

Linux Server 安全相关设置,布布扣,bubuko.com

Linux Server 安全相关设置

原文:http://hpfan.blog.51cto.com/7707969/1388905

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!