Networking

Add A Message Of the Day (MOTD) To SSH

In today’s article, we’re going to learn how to add a message of the day (MOTD)  to SSH. It won’t be a very long article, ’cause I can refer to some earlier articles. But, I’m sure someone will find it handy.

So, yeah… There have been a lot of SSH articles. I love SSH and it has a ton of features, so they get written about. Here’s a link to a list of previous SSH articles. If you have any SSH questions, you’re free to read those articles. They answer all sorts of SSH questions.

SSH stands for ‘secure shell’ and is a way to remotely manage computers. It’s a handy tool, one I think most users should learn. You can sometimes SSH into a broken computer and repair it. It’s pretty handy that way.

The astute among you might notice that this article is a little late. So, I lost internet connectivity and wrote and scheduled an article – or thought I did…

Normally, WordPress would hold that article in cache – but I wasn’t connected. I seem to recall noticing an error when I did hit the scheduling buttons, but it looked normal so I assumed it’d work. That means I’m writing this article right now, ’cause I don’t really want to break my streak of an article every other day. 

Which also explains why this one is just a short article.

Recently, I covered how to show an SSH banner. Well, this is pretty much the same thing. When someone logs into SSH, they’ll see the banner. When someone logs into SSH, they can also see the MOTD. I figure I’ll give you the option to pick which ever one you want.

Add A Message Of The Day (MOTD) To SSH:

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 CTRL + ALT + T and your default terminal should open.

With your terminal now open, we’re going to use nano to do some file editing. It’s really simple. First:

sudo nano /etc/motd

Add whatever text you want. You can generate a fancy ASCII logo and some text about who’s allowed to access the server and remind hackers (’cause they’ll surely listen) that unauthorized access is illegal. To save your MOTD with nano, just press CTRL + X, then Y, and then ENTER.

That’s actually mostly it. You shouldn’t have to edit the SSH configuration for this, it should just work when you restart the SSH service with:

sudo systemctl restart sshd

SSH should pick it up automatically and now display your brand new SSH MOTD. It’s a ‘message of the day’ so you can change it regularly and SSH should pick up those changes automatically.

Depending, you might not even have to restart the SSH service. I’ve had it use the MOTD automatically, and I’ve had to restart the service to get it to show. You can have some fun and use things like this to generate some ASCII text. It’s your MOTD, do whatever you want with it!

Closure:

See? This was a nice and easy article. If you want to add an MOTD to SSH, you now know how to do so. Also, for the record, I’m getting pretty darned fast at writing articles. Well, some of them are pretty speedy to write. It helps if I don’t have to consult my notes that often. If I do, I often just put them on a different screen and that makes it easier to read them.

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.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

View Comments

Recent Posts

Monitor System Resources With “Resources”

Today is one of those days when I'd like to introduce you to new software…

1 day ago

Short: The Halt Command

Today's article is intentionally short because we're simply going to learn about the basics of…

3 days ago

Installing Flatpaks In Linux

Today we're going to have a pretty easy article where you'll learn about installing Flatpaks…

5 days ago

A Quick Look At The Shutdown Command

This is going to be just a quick article about a command many of you…

1 week ago

Setting Up Coding Environments on Linux for Educational Use

With so many strong attributes, such as robustness and flexibility, Linux stands as a powerful…

1 week ago

View Detailed Hardware Information

There are many tools for showing your hardware information and today we'll get to view…

2 weeks ago