Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any simple and straightforward way in which I can set my Debian 6.0 box to automatically login, at startup, with the root account on the console?

There is no GUI (xserver) installed on the machine.

share|improve this question
1  
If I may pry: why? –  Daniel Andersson Apr 3 '12 at 7:02
    
@Daniel: it's a homework project demo virtual machine, I have to send it to my professor, and he is like "please don't bother me with login credentials" –  gd1 Apr 3 '12 at 7:39
    
You may also find funny that root password is "password" –  gd1 Apr 3 '12 at 8:41
add comment

3 Answers

up vote 1 down vote accepted

I don't have a Debian install handy, but this method works for Slackware and should apply just as well to any system which uses inittab.

As root, edit the file /etc/inittab. Find a line that looks something like the following:

c1:1235:respawn:/sbin/agetty 38400 tty1 linux

Replace that line with (or better yet, comment it out and add) one which reads as follows:

c1:1235:respawn:/sbin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1 

Save the file and reboot.

share|improve this answer
1  
I made a little correction: 1:1235:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1 it works. thank you –  gd1 Apr 3 '12 at 8:17
add comment

You can enable the autologin by modifying the inittab file.

Using any editor Open the file inittab. I have used vim editor

#vim /etc/inittab

Serach for the line.

1:2345:respawn:/sbin/getty 38400 tty1

Replace with as follow

1:2345:respawn:/sbin/mingetty --autologin <user-name>  --noclear tty1

After modifying the inittab restart the system.

Note: before modifying the inittab, keep the backup of it.

share|improve this answer
    
Actually, I accepted the other answer just because it is more similar to the solution I actually applied. Nevertheless, I'm sure your solution is good as well as the other. +1 –  gd1 Apr 3 '12 at 8:18
add comment

Both answers from here didn't work on my os,

I use CUBIAN which is an Debian wheezy based os for ARMv7 on Cubieboard

and my solution (working for me) is using rungetty :

install rungetty

edit /etc/inittab

comment out

1:2345:respawn:/sbin/getty 38400 tty1 

and add

1:2345:respawn:/sbin/rungetty tty1 --autologin YOUR_USER_NAME

edit .bash_profile and at the bottom add

if [ -z "$DISPLAY" ] && [ $(tty) = /dev/tty1 ]; then
while true
do
startx --
sleep 10
done
fi

then it worked !

Thanks to MeanDean on Debian user forum.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.