Today’s article is another SSH article, and it will show you how to show an SSH banner. What’s an SSH banner? It’s a message shown when someone logs into the computer via SSH. This can include warning messages, reminders that they’re being logged, etc…
Why would you want to do this? Well, you can include specific directions in there. You can also do so for regulatory compliance, should you be obligated to warn people that you’re storing their information. Some of the messages are quite formal, but you can write your own.
Once again, SSH stands for ‘Secure Shell’. It’s a way to remotely login and use a remote device. It’s usually done in pure text, terminal mode. You can actually forward x11 and control some graphical applications. That’s easy enough and quite a load of fun.
I’ve actually written many SSH articles. Feel free to peruse them at your leisure. If you have questions about SSH, odds are good that I’ve covered them already. I think SSH is a brilliant tool and so quite a few articles cover the many things you can do with SSH.
I find SSH to be a useful, brilliant tool even when it’s just me in my house. As I also manage some remote stuff and SSH beats flying across the world just to update a computer. The good news is that I’ll eventually run out of SSH article ideas!
With the above in mind, let’s just jump into the article…
Show An SSH Banner:
This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press
Note: We’ll be using ‘nano‘ in this article. Click that link to learn more.
With your terminal now open, it’s time to set up an SSH banner. To start with, we’ll create the banner. You’ll need to start with creating a file like so:
1 | sudo nano /etc/banner |
With your banner file open (and you can name it anything, or you can even place it anywhere), just enter the text you want people to see when they login via SSH. You can make it anything you want, but I tend to keep it brief. Some folks go for the giant ASCII banner types, but I like to keep it simple.
When you’re done writing your banner, you need to save it. To save it in nano, you just press
Now, you need to edit your SSH configuration. To do that you use:
1 | sudo nano /etc/ssh/sshd_config |
Scroll down until you see the following:
1 | #Banner none |
Edit that line to read:
1 | Banner /etc/banner |
If you stored your banner in a different location or a different file name, you must also change the path to suit. Then, save your SSH configuration by pressing
Your next step will be to restart SSH. That command is nice and simple:
1 | sudo systemctl restart sshd |
Next, login again with SSH and you should see your new SSH banner! It’s really that simple. If you don’t see it, make sure to double check because all those steps are necessary.
Closure:
And there you have it. You have another article! This one has shown you how to show an SSH banner. It’s not terribly difficult. It’s also potentially useful. Users are effectively agreeing to the terms you set in them, which may be legally binding. Enjoy your new SSH banner and, if it’s not in a professional setting, feel free to be creative with it!
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.