motd - pesan hari ini, pesan yang ditampilkan saat masuk ke sistem Linux (misalnya, Ubuntu).
Sebelumnya, file yang berisi salam berada di /etc/motd, tetapi sekarang ini adalah satu set skrip yang terletak di direktori /etc/update-motd.d/:
# ls -alh /etc/update-motd.d/
total 56K
drwxr-xr-x 2 root root 4,0K 22 2020 .
drwxr-xr-x 98 root root 4,0K 27 15:31 ..
-rwxr-xr-x 1 root root 1,2K 9 2018 00-header
-rwxr-xr-x 1 root root 1,2K 9 2018 10-help-text
lrwxrwxrwx 1 root root 46 22 2020 50-landscape-sysinfo -> /usr/share/landscape/landscape-sysinfo.wrapper
-rwxr-xr-x 1 root root 4,2K 20 2018 50-motd-news
-rwxr-xr-x 1 root root 604 21 2018 80-esm
-rwxr-xr-x 1 root root 3,0K 21 2018 80-livepatch
-rwxr-xr-x 1 root root 97 12 2018 90-updates-available
-rwxr-xr-x 1 root root 299 3 2019 91-release-upgrade
-rwxr-xr-x 1 root root 129 12 2018 95-hwe-eol
-rwxr-xr-x 1 root root 111 20 2018 97-overlayroot
-rwxr-xr-x 1 root root 142 12 2018 98-fsck-at-reboot
-rwxr-xr-x 1 root root 144 12 2018 98-reboot-required
Urutan tampilan, sebagai aturan, dalam urutan prioritas yang diberikan - 00, 10, dll.
Sebagai hasil dari eksekusi itu ditampilkan:
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-118-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Fri Nov 13 14:30:00 +08 2020
System load: 0.45
Usage of /: 9.8% of 109.84GB
Memory usage: 6%
Swap usage: 0%
Processes: 152
Users logged in: 0
IP address for enp4s0: 192.168.106.12
IP address for enxd037454bea65: 172.17.8.58
IP address for tun0: 10.8.0.1
IP address for docker0: 172.17.0.1
* Introducing self-healing high availability clustering for MicroK8s!
Super simple, hardened and opinionated Kubernetes for production.
https://microk8s.io/high-availability
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
233 .
174 .
New release '20.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Fri Nov 13 08:21:33 2020 from 85.192.x.214
Banyak yang tidak perlu bagi kita - bukan?
Saya akan menonaktifkan bagian tersebut dan menambahkan salam saya sendiri.
Saya akan membuat file dan membuatnya dapat dieksekusi.
# touch /etc/update-motd.d/99-intelcom
# chmod 755 /etc/update-motd.d/99-intelcom
Sekarang saya membukanya di editor mana saja dan menambahkan:
#!/bin/bash
echo -e '\033[34m#######################################################
#\033[33m PBX Intelcom - VoIP "" \033[34m#
#\033[33m www.a*p.ru .(3532)54-0X-0Y \033[34m#
#######################################################\033[0m'
-e β Escape , \033[34m \033[33m β , \033[0m β .
:
\033[30m β ;
\033[31m β ;
\033[32m β ;
\033[33m β ;
\033[34m β ;
\033[35m β ;
\033[36m β ;
\033[37m β .
:
\033[40m β ;
\033[41m β ;
\033[42m β ;
\033[43m β ;
\033[44m β ;
\033[45m β ;
\033[46m β ;
\033[47m β ;
\033[0m β .
sudo run-parts /etc/update-motd.d cat /var/run/motd.dynamic.
00-header- berisi sambutan Selamat datang di Ubuntu 18.04.5 LTS (GNU / Linux 4.15.0-118-generic x86_64)
10-help-text- tautan ke informasi dan dukungan
50-landscape-sysinfomengarah ke skrip untuk mendapatkan informasi sistem
50-motd-news- beberapa berita
80-livepatch- informasi tentang Livepatch
80-esm- informasi tentang Extended Pemeliharaan Keamanan - Pemeliharaan sistem keamanan yang
lebih lama. Skrip lebih lanjut tentang pembaruan, boot ulang, dll.
Untuk menonaktifkan pesan yang tidak perlu, saya hanya memberi mereka hak 400.
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-118-generic x86_64)
-rwxr-xr-x 1 root root 1,2K 9 2018 00-header
-r-------- 1 root root 1,2K 9 2018 10-help-text
lrwxrwxrwx 1 root root 46 30 13:45 50-landscape-sysinfo -> /usr/share/landscape/landscape-sysinfo.wrapper
-r-------- 1 root root 4,9K 14 02:59 50-motd-news
-r-------- 1 root root 604 22 2018 80-esm
-r-------- 1 root root 3,0K 22 2018 80-livepatch
-r-------- 1 root root 97 27 2018 90-updates-available
-r-------- 1 root root 299 19 2017 91-release-upgrade
-rwxr-xr-x 1 root root 165 17 2020 92-unattended-upgrades
-rwxr-xr-x 1 root root 129 27 2018 95-hwe-eol
-rwxr-xr-x 1 root root 111 27 2017 97-overlayroot
-rwxr-xr-x 1 root root 142 27 2018 98-fsck-at-reboot
-rwxr-xr-x 1 root root 144 27 2018 98-reboot-required
-rwxr-xr-x 1 root root 324 13 13:36 99-intelcom
Hasilnya, saya mendapat:
