
TTY にログインすると、次のようなわかりやすいテキストが表示されます。
Ubuntu 16.04.03 LTS
Log-in: username
Password:
Last log-in date/time
Welcome to Ubuntu 16.04.03 LTS
* Documentation:
* Management:
* Support:
9 packages to update
4 updates are security updates
グループ内のすべてのユーザーに対して GUI ターミナルを開くたびに、最後の 2 行が繰り返されるようにしたいadm
(ただし、すべてのユーザーに対して GUI ターミナルを開くたびに、すべてが表示されるようにしてもかまいません)
私は明白なことを試しました:
fab-root@fab-ux-predator:~
$ cd /etc/update-motd.d/
fab-root@fab-ux-predator:/etc/update-motd.d
$ ./90-updates-available
fab-root@fab-ux-predator:/etc/update-motd.d
$ cat /var/lib/update-notifier/updates-available
cat: /var/lib/update-notifier/updates-available: Permission denied
fab-root@fab-ux-predator:/etc/update-motd.d
$
何が足りないのでしょうか?
chmod o+r
PS もちろん、ファイルを保存できますが、それは将来的にも安全でしょうか?
答え1
少し遅いですが、パッケージ/更新情報を生成します。これをユーザー.bashrc
ファイルに追加します。
/usr/lib/update-notifier/apt-check --human-readable
答え2
出力全体は次のようになります/run/motd.dynamic
。
$ grep motd /etc/pam.d -R
/etc/pam.d/sshd:# This includes a dynamically generated part from /run/motd.dynamic
/etc/pam.d/sshd:# and a static (admin-editable) part from /etc/motd.
/etc/pam.d/sshd:session optional pam_motd.so motd=/run/motd.dynamic
/etc/pam.d/sshd:session optional pam_motd.so noupdate
/etc/pam.d/login:# This includes a dynamically generated part from /run/motd.dynamic
/etc/pam.d/login:# and a static (admin-editable) part from /etc/motd.
/etc/pam.d/login:session optional pam_motd.so motd=/run/motd.dynamic
/etc/pam.d/login:session optional pam_motd.so noupdate
したがって、 に.bashrc
以下を追加できます。
[[ -r /run/motd.dynamic ]] && cat /run/motd.dynamic
または:
[[ -r /run/motd.dynamic ]] && grep update /run/motd.dynamic