[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”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

[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.

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

Close your session and log in again.

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.

[vagrant@ichiki_qa ~]# sudo vi /etc/motd Japanese dubbed version Dog: “One! (Welcome back!)”

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.

[Linux] Fun packages (although I don't use them for work)

Thank you for viewing.

 

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

[2025.6.30 Amazon Linux 2 support ended] 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.