Adding a banner to ssh logins

From Spry Wiki

Jump to: navigation, search

One cool thing you can do with ssh is to have a message displayed every time someone attempts to login to your server, for example;

To do this you need to enable banners in your sshd configuration. As root vi /etc/ssh/sshd_config and uncomment out the line

#Banner /some/path

So it reads;

Banner /etc/banner (you can use any path you want)

Then add the message you wish to display to /etc/banner (if it doesn't exist, create it). Restart sshd (how to do this depend on your distro);

root@server [/]# /etc/init.d/sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]

Now next time anyone logs in they will see the message;

root@server [/]# ssh localhost
This computer system is for authorized use only. All activity is logged and
regularly checked by system administrators. Individuals attempting to connect to, 
port-scan, deface, hack, or otherwise interfere with any services on this system 
will be reported.

Recent Changes | RSS Feed RSS