Something has changed in server 16.04 LTS, I can't find tty1, but I need to make an auto-login on tty1 (in console mode), in 14.04 LTS I can make this work.
I can't find /etc/init/tty1.conf
How to, or a link?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityIn Ubuntu 16.04, which uses systemd
, the method is slightly different. I'll quote the relevant bits of my related post How do I override or configure systemd services?:
Say I want to have TTY2 autologin to my user (this is not advisable, but just an example). TTY2 is run by the
getty@tty2
service (tty2
being an instance of the template/lib/systemd/system/getty@service
). To do this, I have to modify thegetty@tty2
service.[…]
In particular, I have to change the
ExecStart
line, which currently is:$ systemctl cat getty@tty2 | grep Exec ExecStart=-/sbin/agetty --noclear %I $TERM
To override this, do:
sudo systemctl edit getty@tty2
And add:
[Service] ExecStart= ExecStart=-/sbin/agetty -a <USERNAME> --noclear %I $TERM
[…]
Now:
$ systemctl cat getty@tty2 | grep Exec ExecStart=-/sbin/agetty --noclear %I $TERM ExecStart= ExecStart=-/sbin/agetty -a <USERNAME> --noclear %I $TERM
And if I do:
sudo systemctl restart getty@tty2
and press CtrlAltF2, presto! I'll be logged into my account on that TTY.
/etc/systemd/system/getty@tty2.service.d/override.conf
with the additional lines, and run systemctl daemon-reload
.
– muru
Sep 19 '17 at 11:37
I used this website to achieve auto-login: http://www.pcworld.com/article/259236/how_to_turn_your_laptop_into_a_typewriter.html.
sudo nano /etc/init/tty1.conf
Again, type your password if requested. You are now editing a configuration file, the last line of which starts with an 'exec' command. Replace that line with:
exec /bin/login -f USERNAME < /dev/tty1 > /dev/tty1 2>&1
Where USERNAME is your own username, of course. Be sure to type this line accurately. Then save the file (Ctrl+O) and exit (Ctrl+X).
Now, let's test again to make sure everything is working correctly. Reboot the computer to see if automatic login works:
sudo reboot now
agetty
's -a
option instead of this.
– muru
Jan 23 '17 at 12:41
/etc/init/tty[1-6].conf
after an upgrade from 14.04... Did you do a fresh install? I could be that you somehow switched to full X11 (graphical) only mode. – Alexis Wilke May 23 '16 at 2:09inittab
login: unix.stackexchange.com/questions/299408/… – Ciro Santilli TRUMP BAN IS BAD Oct 11 '18 at 7:08