2021/01/16

Ubuntuのログイン時に出るWelcomeメッセージを消す

Sakura VPS Ubuntu18 に ssh ログインすると

Sakura VPS Ubuntu18 に ssh ログインすると、以下のようなメッセージが表示される

Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-55-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * Canonical Livepatch is available for installation.
   - Reduce system reboots and improve kernel security. Activate at:
     https://ubuntu.com/livepatch
New release '20.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


SAKURA Internet [Virtual Private Server SERVICE]

Last login: Wed Jan 13 22:53:29 2021 from xxx.xxx.xxx.xxx

motd

このメッセージ群は motd (Message Of The Day) という仕組みで表示されているらしい。/etc/update-motd.d 以下のファイル群がメッセージを表示するスクリプト群となる。

# ls /etc/update-motd.d
00-header  10-help-text  50-motd-news  80-esm  80-livepatch  91-release-upgrade

適当に中身を見て、不要なら exit; を追加してしまえば良い。自分は 80-esm 以外は表示しないようにした。

なお、Sakura VPS の SAKURA Internet [Virtual Private Server SERVICE] このメッセージは /etc/motd に仕込まれている。

サイト内検索