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

table of contents
Hello, this is inusuki from the System Solutions Department.
Recently, I've been building my own application server, but it doesn't look very cool, so I wanted to change it
I'll take it easy.
/etc/motd
The contents of this file will be output by sshd on the CLI when a user successfully logs in
By the way, "motd" stands 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 the session and log back in
PS C:\Users\ichik\ichiki_qa> vagrant ssh "bowwow(You're back.)" [vagrant@ichiki_qa ~]$
It feels good
I'll try other things too
[vagrant@ichiki_qa ~]# sudo vi /etc/motd Japanese dubbed version Dog: "Woof! (Welcome home!)"
PS C:\Users\ichik\ichiki_qa> vagrant ssh Japanese dubbed version Dog: "Woof! (Welcome home!)" [vagrant@ichiki_qa ~]$
I did a cool one too, but it doesn't look good on the blog so I'll just show it as an image
A little seriously
With such strong opinions, it seems unlikely that the work environment will be any different
Well, it's best to check based on the IP address each time, but because of my job it makes me feel uneasy, so I thought this might be an option
By the way, it is not possible to embed and execute commands or scripts in /etc/motd itself
(However, depending on the distribution, there may be a directory called /etc/update-motd.d by default,
It seems relatively easy to create dynamic messages by placing your own script under it.)
So, if you really want to dynamically generate the contents of /etc/motd, your only option will likely be to run a script that overrides /etc/motd using cron, or to use a tool like that
It's interesting because there are packages that allow you to customize the appearance of the terminal and play around with the CLI
If you'd like, I'd be happy if you also read this related article
Thank you for viewing.
13