1

I want to enable auto-logon with root user for some specific purpose. It's so boring that every time I power on my PC to study, I have to input user and password.

tshepang
  • 65,642
Tien Quan
  • 19
  • 1
  • 3

2 Answers2

2

I'd recommend you to still use a regular user, but to configure sudo without password. Anytime you need to do a root command, you can just do:

# sudo command

If you want to have a terminal opened with sudo shell, do

# sudo bash

Note this is still giantic hole in the security of your system :-) As root do:

# visudo

and add this line:

yourusername ALL=NOPASSWD: ALL

If you like this solution, you can maybe slightly increase the security by configuring long timeout for passwords. So you only will be asked one an hour/day or week.

lzap
  • 2,102
2

I think you just need to edit this file (/etc/lightdm/lightdm.conf) and add the following line:

autologin-user = root
slm
  • 369,824
  • 4
    Please note, this is a gigantic hole in the security of your system! – Braiam Aug 01 '13 at 12:30
  • @Braiam - in general yes. It kind of goes without saying that you wouldn't do this on a server. But if it's a desktop system running Fedora and it's for personal use then user's can do as they wish. – slm Aug 01 '13 at 12:32
  • My comment wasn't for you, but for anyone who read the answer ;). But I can't mention @readers. – Braiam Aug 01 '13 at 12:38
  • @Braiam - I figured, I was just qualifying your comment. – slm Aug 01 '13 at 12:50
  • Thank you, slm. And thank for your recommend, Braiam, i'm system administration and your caution is the fisst lesson :) – Tien Quan Aug 01 '13 at 13:49
  • This does not work for me. I tried adding the line in the sections [Seat:*] and/or [LightDM], but on Debian Buster it does not do anything. How could I debug this? – Luc Jan 21 '19 at 11:07