【转】关于SSH Server Log 和 Error Messages

【转】关于SSH Server Log 和 Error Messages

时间:2013-09-25 09:09:20      作者:vaster      标签: Linux ssh      分类: Linux Linux安全

上周末正式将VPS环境从BurstNET切换到了Linode,还没来得及做密码登陆功能的取消工作,今天上去一查ssh的log发现很多可疑行为:

Jun 4 02:50:27 li409-245 sshd[2615]: reverse mapping checking getaddrinfo for ip223.hichina.com [223.4.25.38] failed – POSSIBLE BREAK-IN ATTEMPT!
Jun 4 02:50:27 li409-245 sshd[2615]: Invalid user marc from 223.4.25.38
Jun 4 02:50:50 li409-245 sshd[2655]: reverse mapping checking getaddrinfo for ip223.hichina.com [223.4.25.38] failed – POSSIBLE BREAK-IN ATTEMPT!
Jun 4 02:50:50 li409-245 sshd[2655]: Invalid user matt from 223.4.25.38
Jun 4 02:53:05 li409-245 sshd[2813]: reverse mapping checking getaddrinfo for ip223.hichina.com [223.4.25.38] failed – POSSIBLE BREAK-IN ATTEMPT!Jun 4 02:53:05 li409-245 sshd[2813]: Invalid user sam from 223.4.25.38
Jun 4 02:53:05 li409-245 sshd[2813]: Invalid user sam from 223.4.25.38

查了下hichina.com是中国万网,我基本上能想象上述的ssh日志代表了什么意思。于是乎,马上取消密码登陆,把ssh2的秘钥登陆做好。

然后我抽时间查了下ssh日志里的几种错误信息的意思,这里做下笔记。所有下述内容全部译自:http://scottlinux.com/2012/03/07/troubleshooting-ssh-server-logs-and-error-messages/,因本人的linux功底不深,翻译难免有错漏,请读者不吝指出问题。

1. 错误1:

Mar 5 00:44:32 li166-66 sshd[11455]: Invalid user kristina from 192.168.57.214

上述的错误表示的是:来自IP192.168.57.214的某人,在使用非法的/随机的用户名来尝试登陆你的系统

2. 错误2:

Mar 5 05:46:48 li166-66 sshd[12350]: Did not receive identification string from 192.168.144.206

上述的错误表示的是:ssh服务器没能在时限内得到需求的内容。这种问题出现的普遍情况是网络连接问题。在一次ssh连接中,服务器首先提供它的认证字串,然后等待客户端提供它的认证字串。如果这时候连接断开了,或者客户端直接下线了,你就会看到上述错误。 如果某人尝试使用telnet或netcat来连接你的ssh,或者其他某种扫描,你也会看到上述日志。

3. 错误3:

Mar 5 05:50:03 li166-66 sshd[12317]: error: connect_to 172.16.198.59 port 80: Invalid argumentMar 5 05:50:03 li166-66 sshd[12317]: error: connect_to 172.16.198.59 port 80: failed.
Mar 5 05:50:03 li166-66 sshd[12317]: error: connect_to 172.16.198.59 port 80: failed.

上述错误表示的是:某人正在尝试攻击你的服务器、扫描你服务器的端口或检测你服务器正在运行的ssh服务器的转发功能。

4. 错误4:

Mar 5 08:36:35 li166-66 sshd[24856]: reverse mapping checking getaddrinfo for ip144.hichina.com [122.70.144.206] failed - POSSIBLE BREAK-IN ATTEMPT!

上述错误表示的是:连接进来的客户端没有或有一个错误的反向DNS服务。这种错误信息并不一定代表你的服务器收到”break-in attempt”,也就是遭到攻击。

5. 错误5:

Mar 7 09:38:31 li166-66 sshd[25687]: refused connect from 192.168.210.80 (192.168.210.80)

如果你看到上述的错误日志,表示你使用denyhosts屏蔽了某些IP地址。这意味着上述的IP地址在/etc/hosts.deny中有被描述到,服务器拒绝了这些地址来的连接。

6. 错误6:

Mar 7 09:38:31 li166-66 sshd[25687]: Bad protocol version identification 'unknown' from 192.168.4.10

在握手开始的手,服务器会检查客户端的ssh版本。如果客户端提供的字符串是非法的,或者协议中其他某些内容不正确,你就会在你的日志中看到上述内容。

 

转自:http://xenojoshua.com/2012/06/ssh-server-log-and-error-messages/

时间:2013-09-25 09:09:20      作者:vaster      标签: Linux ssh      分类: Linux Linux安全
  • 分享到:
  • 微博
  • QQ空间
  • 腾讯微博
  • 微信

Copyright © 2015 Gitblog | Proudly powered by Gitblog.