内容へ移動
fl8 Wiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
Dokuwiki.fl8.jp
»
50 日記
»
2022
»
08
»
2022.08.31 ubuntu motd
トレース:
50_dialy:2022:08:31
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== 2022.08.31 ubuntu motd ====== ubuntuでmotdを修正する方法 ===== /etc/update-motd.d/以下のスクリプトが実行されている ===== <code> root@regist01:~# ls -al /etc/update-motd.d/ total 68 drwxr-xr-x 2 root root 4096 Aug 31 06:32 . drwxr-xr-x 100 root root 4096 Aug 31 06:28 .. -rwxr-xr-x 1 root root 1220 Dec 5 2019 00-header -rwxr-xr-x 1 root root 1157 Dec 5 2019 10-help-text lrwxrwxrwx 1 root root 46 Aug 24 2021 50-landscape-sysinfo -> /usr/share/landscape/landscape-sysinfo.wrapper -rwxr-xr-x 1 root root 5023 Aug 17 2020 50-motd-news -rwxr-xr-x 1 root root 96 Jul 23 2021 85-fwupd -rwxr-xr-x 1 root root 106 Jul 27 2021 88-esm-announce -rwxr-xr-x 1 root root 218 May 14 2021 90-updates-available -rwxr-xr-x 1 root root 112 Jul 27 2021 91-contract-ua-esm-status -rwxr-xr-x 1 root root 374 Jul 17 2020 91-release-upgrade -rwxr-xr-x 1 root root 165 Jul 21 2020 92-unattended-upgrades -rwxr-xr-x 1 root root 129 May 14 2021 95-hwe-eol -rwxr-xr-x 1 root root 111 Feb 25 2020 97-overlayroot -rwxr-xr-x 1 root root 142 May 14 2021 98-fsck-at-reboot -rwxr-xr-x 1 root root 144 May 14 2021 98-reboot-required </code> ===== ファイルを追加してみる ===== ファイル追加後、実行権限追加 <code> # cat << __EOM__ | tee /etc/update-motd.d/99-test #!/bin/bash echo 'test message: Hello World.' __EOM__ # chmod +x /etc/update-motd.d/99-test </code> これでログインしてみると 「test message: Hello World.」が追加されている <code> $ ssh root@10.10.10.250 Warning: Permanently added '10.10.10.250' (RSA) to the list of known hosts. Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-125-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage System information as of Wed 31 Aug 2022 06:38:26 AM UTC System load: 0.09 Processes: 142 Usage of /: 27.4% of 23.45GB Users logged in: 1 Memory usage: 7% IPv4 address for docker0: 172.17.0.1 Swap usage: 0% IPv4 address for enp1s0: 10.10.10.250 75 updates can be applied immediately. To see these additional updates run: apt list --upgradable New release '22.04.1 LTS' available. Run 'do-release-upgrade' to upgrade to it. test message: Hello World. Last login: Wed Aug 31 06:37:08 2022 from 10.10.0.1 </code> {{tag>ubuntu}}
50_dialy/2022/08/31.txt
· 最終更新: 2022/08/31 06:39 by
matsui
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ