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.

  • 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. Jun 17 '10 at 0:21

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
  • 1
    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. Jun 17 '10 at 7:01
  • 2
    @hekevintran: What version of Ubuntu? Do you have a /etc/init/tty1.conf? If so, make the change there. Jun 17 '10 at 9:36
  • I'm running 10.04. Jun 17 '10 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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