1847195 Members
5593 Online
110263 Solutions
New Discussion

Last Login

 
SOLVED
Go to solution
B.Mahendra Kumar_2
Occasional Advisor

Last Login

Dear All,

Is it possible to find out the last login by using the IP address, If so can you please let me know how to go about it.

TIA
MKBS
5 REPLIES 5
morganelan
Trusted Contributor

Re: Last Login

Try this:
#last -R or
#lastb -R
Kamal Mirdad
Patrick Wallek
Honored Contributor
Solution

Re: Last Login

The 'last -R' command will show logins and the IP address OR host name that they came from.

So, use 'last -R' and grep for the appropriate IP address or hostname.
B.Mahendra Kumar_2
Occasional Advisor

Re: Last Login

Dear all,

Thanks for reply, I made a lastb -R | grep IP and it gave the output...I know this might be a very silly question...It just slipped out of mind. Any how thanks for the quick response...
Arunvijai_4
Honored Contributor

Re: Last Login

The lastb command searches backwards through the database file /var/adm/btmp to display bad login information.

The last command searches backwards through the file /var/adm/wtmp (which contains a record of all logins and logouts) for information about a user, a tty, or any group of users and ttys.

(Taken from #man last)

-- Arun
"A ship in the harbor is safe, but that is not what ships are built for"
B.Mahendra Kumar_2
Occasional Advisor

Re: Last Login

Thanks morg,patrick and arun...

I got the solution from the lastb command...

Its nice to be in the circle:)