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

Enable/Disable Your Network Interface

Today we'll cover one way to enable or disable your network interface in the Linux…

5 months ago

Check Your NIC Speed In The Terminal

Today's exercise is a nice and simple exercise where we check your NIC speed in…

5 months ago

Easily Monitor Your Wireless Connection

Have you ever wanted to easily monitor your wireless connection? Well, now you can learn…

6 months ago

Count The Files In A Directory

I think I've covered this before with the ls command but this time we'll count…

6 months ago

Get System Information With The ‘uname’ Command In Linux

Today we'll be learning about a basic Linux command that's known as 'uname' and it…

6 months ago

hardinfo Has Been Rebooted As hardinfo2

If you've used hardinfo in the past, it may interest you to know that hardinfo…

6 months ago