0

In /etc/securetty I commented out tty2 and tty3:

#tty2
#tty3

This succesfully disables root login for these two terminals for root.

But is it possible to display a message such as "root login is disabled in this terminal" if a login attempt is made?

terdon
  • 54,564
max
  • 4,163

1 Answers1

0

You can get the current terminal with the tty command, so you can put something like this in the user's .bash_profile file:

if [ `tty` = "/dev/pts/0" ]
then
   echo "......."
fi
golimar
  • 1,904