Walker News

How To Disable SSH Print Last Login Info Feature?

By default, SSHD is configured to display previous login information immediately after user login successfully.

Apparently, this simple message that prints date/time and IP address of last login is useful for security reason:
login as: root
Authenticating with public key "rsa-key-20100506"
Passphrase for key "rsa-key-20100506":
Last login: Fri Apr 29 10:40:18 2011 from

For privacy reason, however, some people may find it annoying. If you think there is enough security logs and preventive measures in place, you can prevent SSH server (SSHD) displays the previous login info:

Edit /etc/ssh/sshd_config file and set PrintLastLog to “no”, i.e.
PrintLastLog no

Save the sshd_conf file and restart SSHD (command used to restart SSHD on RedHat Linux):
service sshd restart

In my test on RHEL 5.2, restarting SSHD doesn’t drop any of the active SSH connections :)

Custom Search

  1. Anton 11-11-12@17:41

    Nice info, thanks!

2017  •  Privacy Policy