Last login from <ip address>

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2006
Posts: 1,845
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 119
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso

Last login from <ip address>

 
0
  #1
Jan 18th, 2008
You would have seen this message when you telnet to an unix machine, it displays
last login from <ip address> message
What is the sytem command for displaying the same ? Can I code it in C++ without using system command ?
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 181
Reputation: Paul.Esson is an unknown quantity at this point 
Solved Threads: 10
Paul.Esson's Avatar
Paul.Esson Paul.Esson is offline Offline
Junior Poster

Re: Last login from <ip address>

 
0
  #2
Jan 20th, 2008
Hey,

There is a lastlog command in unix that displays the contents of the /var/log/lastlog file, This is a binary file and a structure describing the contents is located in the <bits/utmp.h> header file

struct lastlog
{
#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
int32_t ll_time;
#else
__time_t ll_time;
#endif
char ll_line[UT_LINESIZE];
char ll_host[UT_HOSTSIZE];
};
anyhow more useful is prolly this example of a lastlog editor written in C that can be found here
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC