-   Linux - Newbie (
-   -   Display Last Login message for users (

smile_laguna 02-27-2004 11:54 AM

Display Last Login message for users
I've installed Redhat 9 and I found that only root has the last login message like "Last login: <when> from <where>" but not the users.

How can I enable this for all the users?


druuna 02-27-2004 01:10 PM

Must be a setting in /etc/login.defs.

Check man login.defs, especially this part:


LASTLOG_ENAB (boolean)
If yes, and if the /var/log/lastlog file exists, then a successful user
login will be recorded to this file. Furthermore, if this option is enabled
then the times of the most recent successful and unsuccessful logins will be
displayed to the user upon login. The unsuccessful login display will be
suppressed if FAILLOG_ENAB is not enabled. If ``hushlogin'' conditions are
in effect, then both the successful and unsuccessful login information will
be suppressed.
Hope this helps.

smile_laguna 02-27-2004 10:22 PM

Thanks very much!!

I've put that in login.defs after your kind instructions, but it is still not effective yet. What should I do next?

smile_laguna 02-27-2004 10:48 PM

Ar.... I forgot to tell u one thing. I'm now trying to let the users to login via SSH. I found that only root has the Last login message but not the other users.

However, when I use the normal telnet, the message is there whoever logs in.

It seems that the login.defs isn't the one to control the appearance of that message in my system. Is it the special feature RH9? Then where can I control the login behaviour?

Thanks very much again!

druuna 02-28-2004 01:40 AM

If telnet shows the information and ssh does not, then login.defs is ok. You probably need to look at the ssh config files.

Change this entry in /etc/ssh/sshd_config:

ChallengeResponseAuthentication no
#ChallengeResponseAuthentication no

That should do the trick for ssh.

All times are GMT -5. The time now is 07:40 PM.