LaoBlog

Kubuntu 15.04 root login with sddm


Since Kubuntu 15.04 provides a new login manager, called sddm, as usual only logins above a certain ID (1000) is permitted. There are scenarios when you want to login in a graphical environment using the root account. Although many complains it is not the right thing to do, the pc is yours, and you have the right to do what you want. Therefore here I show you haw to enable root login on Sddm. I assume you know what you're doing, I don't take any responsibility if after following this Howto you can't login anymore!I assume you've already set up a password for the root account.First at all, you need to modify /etc/sddm.conf as following:[Autologin] Relogin=false Session= User= [General] HaltCommand= RebootCommand= [Theme] Current=breeze CursorTheme=oxy-black [Users] HideShells=/usr/sbin/nologin,/bin/false,/bin/sync MaximumUid=65000 MinimumUid=0We've changed MinumumUid from 1000 to 0 (the root ID) and added the HideShells row to avoid system users appear in the login window. You'll find out that the system user called Speech-dispatcher will still appear on Sddm: this is because of a bug, that user has /bin/sh as login shell which is a security issue; you can safely change his login shell in /etc/passwd from /bin/sh to /usr/sbin/nologin. In that way Speech-dispatcher won't appear on the login window anymore.Second, you need to modify /etc/pam.d/sddm. Be careful! If you don't pay attention here you will end by locking yourself out from your computer!You have to comment out the following:auth    required        pam_succeed_if.so user != root nopasswdloginso that it'll look like:#auth    required        pam_succeed_if.so user != root nopasswdloginThen uncomment# auth    sufficient      pam_succeed_if.so user ingroup nopasswdloginso that it'll becomeauth    sufficient      pam_succeed_if.so user ingroup nopasswdloginNow you can logout or reboot, and you'll be able to login by using the root account