Save up to 30% on Dedicated Servers – Chat Now!

Your Webhosting Questions
Answered by the Webhosting Experts
Tags +
...
Tags
...
...

How can I display a banner when someone attempts to ssh to my server?

This can be set with the Banner directive in sshd_config.

First create a banner to display upon connection:

root@root [~]# vi /etc/sshd_banner.txt
Set the Banner directive to point to this file and restart sshd:
root@root [~]# cd /etc/ssh/
root@root [/etc/ssh]# cp sshd_config sshd_config.save
root@root [/etc/ssh]# vi sshd_config
root@root [/etc/ssh]# diff sshd_config sshd_config.save
93c93
< Banner /etc/sshd_banner.txt

> #Banner /some/path
root@root [/etc/ssh]# /etc/init.d/sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
Test your new configuration:
root@root [/etc/ssh]# ssh 127.0.0.1

This is a test banner.
Your message/warning etc here.

root@127.0.0.1’s password:

Share

Facebook
Twitter
LinkedIn
Email
WhatsApp

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your my.hivelocity.net account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your my.hivelocity.net account or if you are on the go, please reach out from your valid my.hivelocity.net account email to us here at: support@hivelocity.net. We are also available to you through our phone and live chat system 24/7/365.