Operating System - HP-UX
1758583 Members
1892 Online
108872 Solutions
New Discussion юеВ

SSH Display date/time of last login

 
R_77
Occasional Contributor

SSH Display date/time of last login

Does anyone know how to get SSH (Ver 3.2.2) to display the date and time when a user logs in. I found a variable for the SSH config file call PrintLastLog but it does not work with Ver 3.2.2

Thanks
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: SSH Display date/time of last login

Perhaps try a version of ssh thats newer.

The reason for subsequent releases may have been that this and other features did not work.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alex Grigore
Advisor

Re: SSH Display date/time of last login

I use OpenSSH_3.9, OpenSSL 0.9.7d 17 Mar 2004, HP-UX Secure Shell-A.03.91.002.

The system is set to trusted - when logging on it shows the banner: Last successful login for admin: Thu Nov 10 15:53:50 EET-2EETDST 2005 on tty
Last unsuccessful login for admin: Tue Nov 8 18:37:42 EET-2EETDST 2005

What you could do:
1. upgrade system to trusted and verify if it works for you. If not, go to 2.
2. install a newer version

Hope this helps,
AlexG.
Muthukumar_5
Honored Contributor

Re: SSH Display date/time of last login

You can use last and lastb commans in /etc/profile to give successful and unsuccesful login informations.

--- /etc/profile ---

echo "LAST Successful Login : $(last -R $LOGNAME | head -1)"
echo "LAST Unsuccessful Login : $(lastb -R $LOGNAME | head -1)"

It will give those informations.

hth.
Easy to suggest when don't know about the problem!
Alex Grigore
Advisor

Re: SSH Display date/time of last login

That's a nice one Muthukumar :)

regards,
AlexG
Ralph Grothe
Honored Contributor

Re: SSH Display date/time of last login

Check

grep ^PrintLastLog /opt/ssh/etc/sshd_config

but this shouldn't normally appear in your ssh server's conf file, as it is the default behavior.
But someone may have set it to no.
Madness, thy name is system administration