RCRAMER.COM
Clever website slogan
Home > Tech > Linux

Changing the welcome message in Linux

[MOTD] [ISSUE] [ISSUE.NET]

MOTD

When a user logs in to a linux box via they typically will see a welcome message. Also called the "message of the day." If you have an ubuntu machine then you will see something similar to the following:

Linux my_desktop 2.6.27-11-server #1 SMP Thu Jan 29 20:19:41 UTC 2009 i686 The programs included with the Ubuntu system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. To access official Ubuntu documentation, please visit: http://help.ubuntu.com/

On most systems edit the /etc/motd with your desired contents:

sudo vi /etc/motd

However, on many Ubuntu systems the /etc/motd file is a symbolic link to /var/run/motd which may be rebuilt by /etc/init.d/bootmisc.sh from the /etc/motd.tail template at reboot or whenever /usr/sbin/update-motd runs (via /etc/cron.d/update-motd).

In these situations, edit the /etc/motd.tail file instead or change the /etc/motd symlink to another file, such as /etc/motd.static and make your changes there:

sudo vi /etc/motd.tail

ISSUE

The file /etc/issue is a text file which contains a message or system identification to be printed before the login prompt from the console. It may contain various @char and \char escape sequences that are supported by agetty.

Escape Sequences:

\bInsert the baudrate of the current line.
\dInsert the current date.
\sInsert the system name, the name of the operating system.
\lInsert the name of the current tty line.
\mInsert the architecture identifier of the machine, eg. i486
\nInsert the nodename of the machine, also known as the hostname.
\oInsert the domainname of the machine.
\rInsert the release number of the OS, eg. 1.1.9.
\tInsert the current time.
\uInsert the number of current users logged in.
\UInsert the string "1 user" or " users" where is the number of current users logged in.
\vInsert the version of the OS, eg. the build-date etc.

ISSUE.NET

/etc/issue.net may be displayed before the login prompt on remote connections (ssh, telnet, etc). /etc/issue.net doesn't support the escape sequences available for /etc/issue.

To have /etc/issue.net displayed on ssh conections add or uncomment the line, "Banner /etc/issue.net" in /etc/ssh/sshd_config to have /etc/issue.net displayed. Restart sshd and you are good to go:

sudo vi /etc/issue.net sudo vi /etc/ssh/sshd_config sudo /etc/init.d/ssh restart

Note: PuTTY does not typically display /etc/issue.net until after you enter your logon name.

EXAMPLE

Here's an example of /etc/issue that I like to use:

                           _//_\\
                         ,"    //".
                        /          \
                      _/           |
                     (.-,--.       |
    Hmmmm,           /o/  o \     /
     Interlicious    \_\    /  /\/\
             \       (__`--'   ._)
                     /  `-.     |
                    (     ,`-.  |
                     `-,--\_  ) |-.
                      _`.__.'  ,-' \
                     |\ )  _.-'    |
                     i-\.'\     ,--+.
                   .' .'   \,-'/     \
                  / /         /       \

To use this for /etc/issue you must escape all the backslash characters (replace all the "\" with "\\") as /etc/issue supports escape sequences.

See also: