1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

/etc/motdをいじってSSHログイン時にEC2とかIDCフロンティアみたいにしたい

Last updated at Posted at 2022-06-23

Amazon EC2やIDCフロンティアのサーバーにSSHログインしたときに表示されるこんなやつ、あるじゃないですか。
スクリーンショット 2022-06-23 23.24.18.png
スクリーンショット 2022-06-23 23.24.36.png

SSHログイン時にこんな感じのやつを表示したいなと思って調べてみたところ「/etc/motd」というファイルを作成すると実現可能だとわかったので試してみました。

今回、SSHログイン時に表示するメッセージの作成には「Text to ASCII Art Generator (TAAG)」を利用させてもらいました。

TAAGの画面でSSHログイン時に表示させる文字(今回は「akase244」)を入力して「Test All」ボタンをクリックします。

スクリーンショット 2022-06-23 23.33.03.png

表示された全パターンから好きなフォントを探します。
今回はIDCフロンティアっぽい「3D-ASCII」が気に入ったので、「Select & Copy」ボタンをクリックします。

スクリーンショット 2022-06-23 23.35.31.png

SSHログイン時にメッセージを表示したいサーバーにログインして「/etc/motd」ファイルを作成します。(先程コピーしておいた内容を貼り付けます)

$ sudo vim /etc/motd
$ cat /etc/motd


 ________  ___  __    ________  ________  _______     _______  ___   ___  ___   ___     
|\   __  \|\  \|\  \ |\   __  \|\   ____\|\  ___ \   /  ___  \|\  \ |\  \|\  \ |\  \    
\ \  \|\  \ \  \/  /|\ \  \|\  \ \  \___|\ \   __/| /__/|_/  /\ \  \\_\  \ \  \\_\  \   
 \ \   __  \ \   ___  \ \   __  \ \_____  \ \  \_|/_|__|//  / /\ \______  \ \______  \  
  \ \  \ \  \ \  \\ \  \ \  \ \  \|____|\  \ \  \_|\ \  /  /_/__\|_____|\  \|_____|\  \ 
   \ \__\ \__\ \__\\ \__\ \__\ \__\____\_\  \ \_______\|\________\     \ \__\     \ \__\
    \|__|\|__|\|__| \|__|\|__|\|__|\_________\|_______| \|_______|      \|__|      \|__|
                                  \|_________|                                          
                                                                                        
                                                                                        

一旦ログアウトして、再度SSHログインすると、「/etc/motd」で設定した内容が表示されました。

% vagrant ssh



 ________  ___  __    ________  ________  _______     _______  ___   ___  ___   ___     
|\   __  \|\  \|\  \ |\   __  \|\   ____\|\  ___ \   /  ___  \|\  \ |\  \|\  \ |\  \    
\ \  \|\  \ \  \/  /|\ \  \|\  \ \  \___|\ \   __/| /__/|_/  /\ \  \\_\  \ \  \\_\  \   
 \ \   __  \ \   ___  \ \   __  \ \_____  \ \  \_|/_|__|//  / /\ \______  \ \______  \  
  \ \  \ \  \ \  \\ \  \ \  \ \  \|____|\  \ \  \_|\ \  /  /_/__\|_____|\  \|_____|\  \ 
   \ \__\ \__\ \__\\ \__\ \__\ \__\____\_\  \ \_______\|\________\     \ \__\     \ \__\
    \|__|\|__|\|__| \|__|\|__|\|__|\_________\|_______| \|_______|      \|__|      \|__|
                                  \|_________|                                          
                                                                                        
                                                                                        
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?