20 November 2007

How to configure the Virtual console login to display a pre-login message with Virtual Console Name?

Virtual console login prompts for a login name and invokes the /bin/login command to process the user login.mingetty handles all of these as well as opening the tty port and setting the needed modes.

tty is a kernel layer used by all Linux users to type commands at a prompt or at a serial port connection.

In order to differentiate the 6 virtual console login from each other to avoid confusion and quickly identify the current tty when having multiple users logging in locally,its possible to edit the pre-login message in the /etc/issue file.

Configure /etc/issue as below
Red Hat Enterprise Linux Server release 5.1 Beta (Tikanga)
Kernel \r on an \m
You are currently On Virtual Console \l

mingetty supports the below escape sequences to display various information:
  • \d - current day (localtime)
  • \l - current tty
  • \m - machine architecture (uname -m)
  • \n - hostname (uname -n)
  • \o - domain name (domainname)
  • \r - operating system release (uname -r)
  • \t - current time (localtime)
  • \s - operating system name
  • \u - number of users currently logged in
  • \v - operating system version (uname -v)
The tty command displays the current tty file used once the user is successfully logged in.

$tty
/dev/tty2

Output:

Red Hat Enterprise Linux Server release 5.1 Beta (Tikanga)
Kernel 2.6.18-37.el5xen on an i686
You are currently On Virtual Console tty3
client1 login:



No comments: