[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Linux] Cool thing that appears when logging in via SSH (/etc/motd)

Hello, this is inusuki from the System Solutions Department.

Recently, I've been building an application server by myself, but it doesn't look very cool, so I wanted to change it.

I'll take it easy.

/etc/motd

sshd will output the contents written in this file to the CLI when the user successfully logs in.

By the way, "motd" is an abbreviation for Message Of The Day.

Let's try it now

Let's do this like this.

1
[vagrant@ichiki_qa ~]# sudo vi /etc/motd "bowwow(You're back.)"

Close your session and log in again.

1
PS C:\Users\ichik\ichiki_qa> vagrant ssh "bowwow(You're back.)" [vagrant@ichiki_qa ~]$

It feels good.

I'll try other things as well.

1
[vagrant@ichiki_qa ~]# sudo vi /etc/motd Japanese dubbed version Dog: “One! (Welcome back!)”
1
PS C:\Users\ichik\ichiki_qa> vagrant ssh Japanese dubbed version Dog "One! (Welcome back!)" [vagrant@ichiki_qa ~]$

I've done some cool ones, but they won't look good on the blog, so I'll use images instead.

Just a little bit seriously

With someone so assertive, it's hard to go wrong with the work environment.

Well, it would be better to check based on IP each time, but since my job makes me nervous, I thought something like this might be a good idea.

 

By the way, it is not possible to embed and execute commands or scripts in /etc/motd itself.

(However, depending on the distribution, a directory called /etc/update-motd.d exists by default,

You can generate dynamic messages by placing your own script under it, so it seems relatively easy.)

So, if you really want to dynamically generate the contents of /etc/motd, you have no choice but to run a script that overrides /etc/motd with cron or use such a tool. I agree.

 

There are also packages that allow you to customize the appearance of the terminal and play with the CLI, which is interesting.

I would appreciate it if you would also read this related article.

Thank you for viewing.

 

If you found this article helpful , please give it a like!
13
Loading...
13 votes, average: 1.00 / 113
5,075
X facebook Hatena Bookmark pocket
[2026.6.30 Amazon Linux 2 end of support] Amazon Linux server migration solution

[2026.6.30 Amazon Linux 2 end of support] Amazon Linux server migration solution

The person who wrote this article

About the author

inusuki

Joined Beyond as a new graduate in April 2021.
Maybe it's because I have a problem with my output, but sometimes I say strange things.