+ -
当前位置:首页 → 问答吧 → ssh有关的,lastb记录域名不全的问题

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

时间:2009-05-19

来源:互联网

安全版块没有人管,无耐发个重复贴吧
代码:
root@www:/var/log# lastb | more
id ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
login ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
download ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
project ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
email ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
contact ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
database ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
data ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
educatio ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
post ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
forum ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
happy ssh:notty vserver1673.vser Sat May 16 00:37 - 00:37 (00:00) 
root ssh:notty 85.17.36.42 Fri May 15 12:17 - 12:17 (00:00) 
root ssh:notty 85.17.36.42 Fri May 15 11:15 - 11:15 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00) 
root ssh:notty host252.b1.nw.co Fri May 15 10:45 - 10:45 (00:00)
像后面的host252.b1.nw.co ,很明显就是记录的不全的域名
如果让它只记录IP地址,以便做进一步的处理?

作者: 心之语   发布时间: 2009-05-19

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

作者: slackcode   发布时间: 2009-05-19

谢谢!
那能否让它只记录IP地址呢?

作者: 心之语   发布时间: 2009-05-20

引用:
作者: 心之语
谢谢!
那能否让它只记录IP地址呢?
这个我不太清楚啊,我平时没有用lastb的经验,照着man试试看,哈

作者: slackcode   发布时间: 2009-05-21

非常感谢:)

作者: 心之语   发布时间: 2009-05-21