WSL2 Ubuntu ログインメッセージ抑止

WSL2 Ubuntu ログインメッセージ抑止

WSL2 Ubuntu ログインメッセージ抑止

Ubuntuのログインメッセージ抑止

2024年3月、WSL2にUbuntu 22.04.3 LTSをインストールしました。


$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy
$

Ubuntuを起動すると下記のようなログインメッセージを表示します。


Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.133.1-microsoft-standard-WSL2 x86_64)

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


This message is shown once a day. To disable it please create the
/home/pi/.hushlogin file.
$

このログインメッセージを抑止するには、
ホームディレクトリ(/home/pi/)にtouchコマンドで「.hushlogin」というファイルを作成します。


$ pwd
/home/pi
$ touch .hushlogin
$

ログアウトして再度ログインするとログインメッセージは表示されなくなります。