3

I have an ARM server running Ubuntu 16.04. I am connecting to the machine via the serial port.

When I reboot the system, it automatically logs in as root, without the usual username/password prompt. This is what I see after it completes the usual bootup stuff:

Ubuntu 16.04.3 LTS ubuntu ttyAMA0

ubuntu login: root (automatic login)

Last login: Thu Mar  1 08:07:07 UTC 2018 on ttyAMA0
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.8.0-32-t99-perf aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

50 packages can be updated.
1 update is a security update.


root@ubuntu:~# 

How can I configure it so it prompts for the username/password instead?

2
  • 1
    Maybe you have to edit /lib/systemd/system/getty@.service, check here. Mar 1, 2018 at 1:33
  • I looked at this file, however a diff between it and the same file on a similar system (which does NOT auto-login) shows they are identical
    – Paul M
    Mar 1, 2018 at 15:17

1 Answer 1

2

@Pablo Bianchi's comment was close... It turns out the file I needed to edit was:

/lib/systemd/system/serial-getty@.service

Specifically change this line:

ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I $TERM

to:

ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM

Hurrah for grepping blindly and arriving at a solution!

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.