LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 767|回复: 4

ssh有关的,lastb记录域名不全的问题

[复制链接]
发表于 2009-5-19 14:36:17 | 显示全部楼层 |阅读模式
安全版块没有人管,无耐发个重复贴吧
  1. [align=LEFT]root@www:/var/log# lastb | more
  2. id       ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  3. login    ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  4. download ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  5. project  ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  6. email    ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  7. contact  ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  8. database ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  9. data     ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  10. educatio ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  11. post     ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  12. forum    ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  13. happy    ssh:notty    vserver1673.vser Sat May 16 00:37 - 00:37  (00:00)   
  14. root     ssh:notty    85.17.36.42      Fri May 15 12:17 - 12:17  (00:00)   
  15. root     ssh:notty    85.17.36.42      Fri May 15 11:15 - 11:15  (00:00)   
  16. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  17. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  18. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  19. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  20. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  21. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  22. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  23. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  24. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  25. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  26. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  27. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  28. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)   
  29. root     ssh:notty    host252.b1.nw.co Fri May 15 10:45 - 10:45  (00:00)[/align]
复制代码
像后面的host252.b1.nw.co ,很明显就是记录的不全的域名
如果让它只记录IP地址,以便做进一步的处理?
发表于 2009-5-19 16:44:46 | 显示全部楼层
OPTIONS
       -num   This is a count telling last how many lines to show.

       -n num The same.

       -t YYYYMMDDHHMMSS
              Display the state of logins as of the specified time.  This is useful, e.g., to determine easily who was logged in at a particular time --  specify
              that time with -t and look for "still logged in".

       -R     Suppresses the display of the hostname field.

       -a     Display the hostname in the last column. Useful in combination with the next flag.

       -d     For  non-local  logins, Linux stores not only the host name of the remote host but its IP number as well. This option translates the IP number back
              into a hostname.

       -i     This option is like -d in that it displays the IP number of the remote host, but it displays the IP number in numbers-and-dots notation.

       -o     Read an old-type wtmp file (written by linux-libc5 applications).

       -x     Display the system shutdown entries and run level changes.

man lastb,上面参数应该的有帮助,试试lastb -a
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-20 17:26:57 | 显示全部楼层
谢谢!
那能否让它只记录IP地址呢?
回复 支持 反对

使用道具 举报

发表于 2009-5-21 08:50:01 | 显示全部楼层
Post by 心之语;1989221
谢谢!
那能否让它只记录IP地址呢?


这个我不太清楚啊,我平时没有用lastb的经验,照着man试试看,哈
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-21 14:08:44 | 显示全部楼层
非常感谢:)
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表