Help - Search - Members - Calendar
Full Version: ssh last login record
The Planet Forums > General > Suggestions/Comments
dragon
when i logged into my box via ssh.. it does not display the last login record.. how to solve it?? thanks
icon_question.gif
klaude
What operating system are you using?
GoltharNL
If you use Redhat 9, typing last will give you a list of all the last logged in users
Ferret_dude
someone posted this code wich wil mail you whenever someone has loged in as root with SSH

CODE
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access on Server #1" webmaster@XXXXXXX.com <mailto:webmaster@XXXXXXX.com>

since a intruder could easely cover his/her tracks this wil be a good code to add since you wil be notified by mail
dragon
QUOTE (Ferret_dude)
someone posted this code wich wil mail you whenever someone has loged in as root with SSH

CODE
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access on Server #1" webmaster@XXXXXXX.com <mailto:webmaster@XXXXXXX.com>

since a intruder could easely cover his/her tracks this wil be a good code to add since you wil be notified by mail


yes, i have already add this code in .bash_profile , thanks icon_biggrin.gif

QUOTE
If you use Redhat 9, typing last will give you a list of all the last logged in users


thanks.. i will try.. icon_razz.gif

QUOTE
What operating system are you using?


Redhat 9
Wallace
QUOTE (dragon)
when i logged into my box via ssh.. it does not display the last login record.. how to solve it?? thanks
icon_question.gif


Try in ssh:

chmod go+r /var/log/lastlog

This solved the same problem here icon_smile.gif
GoltharNL
Excellent code snippet icon_biggrin.gif

Hum...gives me a: -bash: syntax error near unexpected token `newline'

As an error no matter what I try (except the right thing I supose) icon_wink.gif
dragon
QUOTE (Wallace)
QUOTE (dragon)
when i logged into my box via ssh.. it does not display the last login record.. how to solve it?? thanks
icon_question.gif


Try in ssh:

chmod go+r /var/log/lastlog

This solved the same problem here icon_smile.gif


thanks icon_biggrin.gif icon_biggrin.gif icon_biggrin.gif problem solved icon_razz.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.