免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2145 | 回复: 4
打印 上一主题 下一主题

关于SSHD安全设置的一点疑问![已解决] [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-06-07 20:55 |只看该作者 |倒序浏览
本帖最后由 w80286 于 2010-06-08 21:37 编辑

系统版本及SSH配置文件如下图:
  1. [root@localhost ssh]# uname -a
  2. Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux
  3. [root@localhost ssh]# cat sshd_config |grep ^[^#]
  4. :#      $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $
  5. Protocol 2
  6. SyslogFacility AUTHPRIV
  7. MaxAuthTries 6
  8. PasswordAuthentication yes
  9. ChallengeResponseAuthentication no
  10. GSSAPIAuthentication yes
  11. GSSAPICleanupCredentials yes
  12. UsePAM yes
  13. AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
  14. AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
  15. AcceptEnv LC_IDENTIFICATION LC_ALL
  16. X11Forwarding yes
  17. MaxStartups 5
  18. Subsystem       sftp    /usr/libexec/openssh/sftp-server
  19. [root@localhost ssh]# rpm -qa|grep ssh
  20. openssh-server-4.3p2-36.el5
  21. openssh-4.3p2-36.el5
  22. openssh-askpass-4.3p2-36.el5
  23. openssh-clients-4.3p2-36.el5
复制代码
我想问的是这个MaxAuthTries 6,它是设置的登陆密码的尝试次数为6次,我在一个系统上做了测试,第7次登陆失败后,系统提示登陆艇错误,就将该连接关闭了。但我马上再重新连接该机器,用正确的用户名和密码照样能登陆,以我对安全方面的了解,它应该是我尝试6次登陆失败过后就锁定该IP一段时间过后才能登陆,这样子才能起到保护系统的目的。

论坛徽章:
0
2 [报告]
发表于 2010-06-07 21:50 |只看该作者
之前没有注意过你说的问题,搜索了一下,关于MaxAuthtries的解释是:
MaxAuthTries
Specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. The default is 6.


所以,这并不能达到你理解的效果。不过,网络上有这样一个例子你可以参考:
LoginGraceTime 2m
MaxAuthTries 6

http://aymanh.com/tips-to-secure-linux-workstation

论坛徽章:
0
3 [报告]
发表于 2010-06-08 14:50 |只看该作者
之前没有注意过你说的问题,搜索了一下,关于MaxAuthtries的解释是:


所以,这并不能达到你理解的效果 ...
零二年的夏天 发表于 2010-06-07 21:50

好的,我试试看,这个地址里面还提到了一个有趣的东西哦:
Protect against Fork Bombs

Fork bombs are programs that keep creating child processes until system resources are all used. They actually aren't remote exploits because they require a local user to execute the bomb; however, users may be tricked into running a fork bomb. For example, the following example may look innocent, but running it on an unprotected system may take the whole system down:
  1. :(){ :|:& }; :
复制代码
Do not run the above code on an unprotected system!

The above shell script will actually keep forking at an exponential rate until system resources are exhausted.

To protect a system against such attacks, there is a file for limiting the number of processes per user. It is /etc/security/limits.conf. Add the following two lines to it:
@users          soft    nproc  100
@users          hard    nproc  150

论坛徽章:
0
4 [报告]
发表于 2010-06-08 15:07 |只看该作者
若你要禁止阻擋存取這類 ip 行為,應該裝個 fail2ban 這類軟件更好。

论坛徽章:
0
5 [报告]
发表于 2010-06-08 21:36 |只看该作者
LoginGraceTime 2m

LoginGraceTime 2m
这个参数,我测试过了,刚刚也查了一下书上,意思是当用户连上ssh server之后,会出现输入密码的画面,在该画面中,在2分钟内没有成功连上ssh server,就断线。
这个M就是指分钟的意思。
谢谢楼上两位的指导。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP