Blog
arrow
2012-06-01 18:26
Autologin in tty console

If you don't want to enter your login and password in tty console, you should do the following:

Run root console and create /usr/sbin/call_bash file with the following contents:

#!/bin/bash
su - your_username

Allow execution of this file:

chmod +x /usr/sbin/call_bash

Check that call_bash command causes opening of console.

Now you should write this command in /etc/inittab. For example, if you want to set up autologin for first 3 consoles, it will look like

c1:2345:respawn:/sbin/agetty -nl /usr/sbin/call_bash -8 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -nl /usr/sbin/call_bash -8 38400 tty2 linux
c3:2345:respawn:/sbin/agetty -nl /usr/sbin/call_bash -8 38400 tty3 linux
c4:2345:respawn:/sbin/agetty -8 38400 tty4 linux
c5:2345:respawn:/sbin/agetty -8 38400 tty5 linux
c6:2345:respawn:/sbin/agetty -8 38400 tty6 linux

-n option disables asking of login; -l option replaces standard /bin/login with our new script.

After a restart changes must take effect.


Up