Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a machine running Ubuntu Server. It has only a command-line interface. How can I make the system login with a specific user automatically (I don't want to type the username/password). I know that this is insecure and I don't care.

share|improve this question
Are you talking about logging in from the console or a remote system? If you are connecting from a remote system just setup SSH key-based authentication. – Zoredache Jun 17 '10 at 0:17
Sorry I should have been clearer. I mean from the console of the machine. – hekevintran Jun 17 '10 at 0:21
up vote 1 down vote accepted

Install mingetty.

sudo apt-get install mingetty

Edit your /etc/event.d/tty1 and change this line:

exec /sbin/getty 38400 tty1


exec /sbin/mingetty --autologin username tty1
share|improve this answer
I did not have a file called /etc/event.d/tty1. I created one and followed the rest of the instructions, but it doesn't work. – hekevintran Jun 17 '10 at 7:01
@hekevintran: What version of Ubuntu? Do you have a /etc/init/tty1.conf? If so, make the change there. – Dennis Williamson Jun 17 '10 at 9:36
I'm running 10.04. – hekevintran Jun 17 '10 at 10:28
Yeah editing that file did the trick. Thanks. – hekevintran Jun 17 '10 at 10:36

Your Answer


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.