
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
파일을 저장할 수 있지만 그것이 미래에도 보장될 수 있을까요?
답변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