It is possible to Append Additional information to the default motd
message by creating a custom /etc/motd
file. For example, let's append the default message with the Welcome Ubuntu User
message.
Related Articles
Open up terminal or TTY console and enter the following linux command:
$ sudo sh -c 'echo "Welcome Ubuntu User" > /etc/motd'
How to modify motd message
Modifying the/etc/motd
file is fast and effective way on how to quickly change the welcome message. However, for more elaborate configuration it is recommend to customize the MOTD via scripts located within the /etc/update-motd.d
directory.Message of the day is modular hence split into various scripts executed in order from lowest to highest number value as part of the script's file name prefix. The following scripts are located within the
/etc/update-motd.d
directory as part of the default motd
daemon configuration:$ ls /etc/update-motd.d/Each script is assigned with Executable Permissions. Feel free to modify any of the above scripts to better fit the
00-header 50-landscape-sysinfo 80-esm 90-updates-available 95-hwe-eol 98-fsck-at-reboot
10-help-text 50-motd-news 80-livepatch 91-release-upgrade 97-overlayroot 98-reboot-required
motd
message output into your system environment.As an exercise, let's customize the
motd
message to show general system information, hard disk usage and the weather information. Let's start by disabling the default scripts.Depending on your needs you can selectively disable one or more scripts by removing the executable permissions. For our example we will disable all scripts and create a new
01-custom
script.- Disable all current default MOTD's daemon scripts
- Install prerequisites
$ sudo chmod -x /etc/update-motd.d/*
$ sudo apt install inxi screenfetch ansiweather