inittab examples for logins

On distributions that use inittab, you can set up login programs for HVC terminal devices through inittab entries.

Each inittab entry starts with an identifier that is unique within inittab. For more information, see the man page for the inittab file.

  • This inittab entry enables user logins on terminal device hvc1 with mingetty.
    h1:2345:respawn:/sbin/mingetty --noclear hvc1

    With mingetty, you must explicitly export the TERM environment variable to specify the terminal capabilities.

  • This inittab entry enables user logins on terminal device hvc2 with agetty and sets the TERM environment variable to xterm at startup.
    h2:2345:respawn:/sbin/agetty -L 9600 hvc2 xterm

    With agetty, you can specify the value to be set for the TERM environment variable as a parameter.

  • This inittab entry enables user logins on terminal device hvc3 with agetty and sets the TERM environment variable to xterm at startup. The ttyrun program prevents recurrent respawns if the terminal is not operational.
    h2:2345:respawn:/sbin/ttyrun hvc3 /sbin/agetty -L 9600 %t xterm

    With agetty, you can specify the value to be set for the TERM environment variable as a parameter.

  • This inittab entry enables user logins in single user mode on terminal device hvc0. Instead of /bin/login, the default login program, the /sbin/sulogin login program is used.
    h0:S:once:/sbin/sulogin hvc0

    The /sbin/sulogin login program requires a login by user root.