Setup autologin on backtrack 5

Backtrack linux by default brings up a login terminal after boot. The user has to login using username/password as root/toor. Then the startx command has to be run to bring up the desktop. Backtrack can be made to autologin to the desktop without having to type anything.

Here are the steps to do it.

Install rungetty

First we need to install the rungetty utility.

$ sudo apt-get install rungetty

Setup autologin

Now edit the file /etc/init/tty1.conf and comment out the following line

exec /sbin/getty -8 38400 tty1

And add the following line

exec /sbin/rungetty tty1 --autologin root

It should finally look like this

# tty1 - getty
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

#exec /sbin/getty -8 38400 tty1
exec /sbin/rungetty tty1 --autologin root

This will setup autologin. It means that the root prompt will come up without asking for a username or password. This is half the work done. Next we have to setup auto desktop too, so that we dont have to type startx everytime to start the desktop.

Setup auto desktop/startx

Run the following command

echo startx >> /root/.bash_profile

This will create the file /root/.bash_profile and add startx to it. Everything we write in this file is going to be executed just after the root logs in. By default backtrack 5 does not have this file. The above command will over write the file if it exists. If you have already created this file then you should edit it using nano, gedit or any other text editor.

This will setup automatic start of the desktop. Now reboot backtrack and the desktop should come up rightaway without asking for anything.

Last Updated On : 25th February 2013

Subscribe to get updates delivered to your inbox

Leave a comment