You may, as me, use the tty now and then, to stop the gdm every now and then or simply enjoy mutt in a glorious full-screen experience.

Whatever the reason, I always want to change the ttys' appearance to fit my needs, so here are some short tips for their customization. Please note that the following works under Ubuntu 10.10 (or later?).

Change the tty font

I'd like to see everything in the console in a smaller font (yeah, mutt is going to rock that way). To do this, update /etc/default/console-setup to make it read:


And I quote the available options:

Valid font faces are: VGA (sizes 8, 14 and 16), Terminus (sizes 12x6, 14, 16, 20x10, 24x12, 28x14 and 32x16), TerminusBold (sizes 14, 16, 20x10, 24x12, 28x14 and 32x16), TerminusBoldVGA (sizes 14 and 16), Fixed (sizes 13, 14, 15, 16 and 18), Goha (sizes 12, 14 and 16), GohaClassic (sizes 12, 14 and 16). You can also directly specify nonstandard font and ACM to load. Use space as separator if you want to load more than one font. # FONT='lat9w-08.psf.gz /usr/local/share/brailefonts/brl-08.psf' # ACM=/usr/local/share/consoletrans/my_special_encoding.acm

Message Of The Day, the after-login text

The Message of the Day is a configurable snippet of text that the user is presented with after every textual login in a tty. It can be easily modified, of course, to display all sort of things.

In "/etc/update-motd.d/" you'll find the classic script priority structure "NN-scriptname", where NN is a priority number between 0 and 100. Each script is called and its output is appended to the motd at every login.

Add new scripts or edit the already existing to suit your needs; as for me, I've quickly brought together a small bash script to display info about the computer fan and temperature:

sensors -u | awk 'BEGIN{ count=0; acc=0; maxtemp=0; } /temp[[:digit:]]+_/{ count++; acc=acc+$2; if($2>maxtemp) 
maxtemp=$2; } /fan1_input/{ fan_rpm=$2; } /fan1_min/{ fan_min=$2; } END{ meantemp=acc/count; 
fan=fan_rpm*100/fan_min; print "Overall computer temperature is", meantemp, "°C with a max of", maxtemp,"°C"; 
print "The fan is at", fan_rpm, "rpm,", fan,"%."; }'

The script's output is shown below:

Overall computer temperature is 55.575 °C with a max of 129.00 °C
The fan is at 1800.00 rpm, 100 %.

Pass the "-f" option to the program sensors in the script above to make it show Fahrenheit degrees instead of Celsius.

How to discourage intruders

Keeping on the topic of terminal messages for tty logins, the message right before the user/password prompt can also be customized: it's a static text file, namely "/etc/issue" on my Ubuntu machine. It can contain simple getty escape chars (see "man getty" for more), and I'm happy with this threatening message:

\l @ \n, \d \t

Access to this system is for authorized persons only.
Unauthorized use or access is regarded as a criminal act and is subject to civil and criminal prosecution.

Please notice the last empty line for a better formatting. Of course, when displayed the first line will read “ttyN @ hostname, date time”.