Dave Perrett

Change the SSH Login Message

linux, quickie, security, ssh

To change the message displayed before login, edit /etc/ssh/sshd_config :

1
$ sudo vi /etc/ssh/sshd_config

and add (or uncomment) the line

1
Banner /etc/banner

/etc/banner can be whatever file you want. Then edit /etc/banner

1
$ sudo vi /etc/banner

and put in whatever welcome message you want:

1
2
3
4
5
.
              |
.  .    . .-. | .-..-. .--.--. .-.
 \  \  / (.-' |(  (   )|  |  |(.-'
  `' `'   `--'` `-'`-' '  '  ` `--'

You’ll probably need to restart sshd before your changes take effect:

1
$ sudo /etc/init.d/ssh restart

To change the message displayed after login, edit /etc/motd :

1
$ sudo vi /etc/motd

and enter the message you want to display.