fgetty - a very small getty for Linux

Download it from fgetty-0.7.tar.bz2,sig [binaries,sig]! The current version is 0.7. Recent changes: runit compatibility, support empty passwords, checkpassword will give error message

fgetty is actually a mingetty stripped of the printfs. Why would anyone do that? Because it can be linked against dietlibc then, yielding a 7k binary with a much smaller memory footprint.

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root      5487  0.0  0.1  1180  444 tty5     S    00:40   0:00 /sbin/mingetty tty5
root      6035  0.0  0.0    20   20 tty5     S    00:45   0:00 /sbin/fgetty tty5

Why is it based on mingetty? Because mingetty has a lot of cool features. For example, some dumb Linux distributions rewrite /etc/issue at every boot to get the Kernel version in there. mingetty (and fgetty) allow escape sequences like \r (kernel version) and \l (tty) in /etc/issue and are thus also useful for machines with read-only /etc directory. Please see the source code or mingetty documentation for a list of all escape sequences.

Please note that (if you use the \t or \d escapes) currently the dietlibc localtime implementation relies on the kernel timezone which is often not set and does not support daylight saving time, so the time and date displays are probably off by an hour or more. Since I don't think displaying the date or time in the login prompt is a very useful idea, that probably does not matter very much.

Now with login!

Starting with version 0.2, fgetty comes with a login replacement that uses DJB's checkpassword. While fgetty is a little Linux specific, the login part should be usable without fgetty on non-Linux systems, too. By the way, in case you are worried to do changes of this magnitude to your system: I am using fgetty with the new login as the standard (and only!) login mechanism on my workstation since early December 2000.

Security Notice

Recently, several buffer overflows have been found in getty and login implementations. Some getty would not work with long tty strings on the command line, and some login programs would not work with long environment variables. In case you wondered: fgetty is not vulnerable.

See also