When you connect to Ubuntu server, you're presented with a "Message of the Day" (MOTD) - and this is customizable.
Ubuntu builds the MOTD dynamically from a set of numbered scripts in /etc/update-motd.d
. These are BASH scripts that run in order - so 00-header
runs first, followed by the next numerically named script. For example, Ubuntu 16.04 has these files in /etc/update-motd.d
by default:
- 00-header
- 10-help-text
- 90-updates-available
- 91-release-upgrade
- 97-overlayroot
- 98-fsck-at-reboot
- 98-reboot-required
- 99-esm
If you want to add a message between the header and the help text, create a bash script in a file named 01-custom-message
and add your message.
When your users log in to the server, they'll see the message.
Here's an example script that displays a table of tools with links:
#!/bin/bash
# save this file as /etc/update-motd.d/01-custom-message
intro="Your Introductory message."
printf "%s\t"
divider===============================
divider=$divider$divider$divider
header="\n %-10s %-40s %-30s\n"
format=" %-10s %-40s %-30s\n"
width=80
printf "\n%s\n" "${intro}"
printf "$header" "TOOL" "DESCRIPTION" "URL"
printf "%${width}s\n" "$divider"
printf "$format" \
"Tool1" "This tool is used for x." "https://example.com/tool1"\
"Tool2" "This tool is used for y." "https://example.com/tool2"\
"Tool1" "This tool is used for z." "https://example.com/tool3"
Alternatively you could create a reference page in HTML format on the server, and leave a reference to this (with a link) in the MOTD message.
From Ubuntu manpages:
MOTD fragments must be scripts in /etc/update-motd.d, must be executable, and must emit
information on standard out.
Scripts should be named named NN-xxxxxx where NN is a two digit number indicating their
position in the MOTD, and xxxxxx is an appropriate name for the script.
Scripts must not have filename extensions, per run-parts(8) --lsbsysinit instructions.
Packages should add scripts directly into /etc/update-motd.d, rather than symlinks to
other scripts, such that administrators can modify or remove these scripts and upgrades
will not wipe the local changes. Consider using a simple shell script that simply calls
exec on the external utility.
http://manpages.ubuntu.com/manpages/trusty/man5/update-motd.5.html