top of page


You Can Modify the Message When You do SSH Login

Did you know that you can change the message you see when you do ssh connect?


The contents of the /etc/motd file are output by sshd on the CLI when a user successfully logs in.

FYI, “motd” stands for “Message Of The Day”.

Let’s try

[vagrant@ichiki_qa ~]# sudo vi /etc/motd
"bow wow(Welcome back.)"

Close the session and log in again.

S C:\Users\ichik\ichiki_qa> vagrant ssh
"bow wow(Welcome back)"
[vagrant@ichiki_qa ~]$

The output looks nice.

I’m going to try other things

[vagrant@ichiki_qa ~]# sudo vi /etc/motd
Japanese version
PS C:\Users\ichik\ichiki_qa> vagrant ssh
Japanese version
[vagrant@ichiki_qa ~]$

I did a cool one too and it came out like the screenshot below.


If you customize the message for each environment, it’ll be helpful to prevent mixing up with other environments if you have multiple projects other than confirming by IP address.

Note that you cannot embed commands or scripts in /etc/motd itself.

*However, some distributions have a directory /etc/update-motd.d by default, where you can place your own scripts to generate dynamic messages, which seems to be relatively easy.

There are packages that you can play around with CLI, you can check our article if you are interested.

This blog post is translated from a blog post written by Tomoki Takeuchi on our Japanese website Beyond Co..


bottom of page