Saturday, October 14, 2006

Linux: Allowing Root Login Under Ubuntu

In a previous article, I demonstrated how you could get root access under Ubuntu. I had a user comment that they would also like to be able to log in as root, not just escalate privileges after login. This really goes against the Ubuntu security paradigm, but is actually a very easy thing to do.


In Ubuntu, the mechanism that prevents the user from logging in as root is the login manager. By default, Ubuntu uses GDM by default, so the instructions will be different under Xubuntu and Kubuntu, or if you have changed your Display Manager/Login Manager. To configure GDM to allow root login, the /etc/gdm/gdm.conf-custom file needs to be modified. The reason you modify this file instead of the /etc/gdm/gdm.conf file is the the latter can be changed during an update, and in later versions of GDM, the gdm.conf-custom file has been provided for user overrides of settings. Any changes in the /etc/gdm/gdm.conf-custom file will take precedence. Under the [security] section, add the following entry:


AllowRoot=true


Thats all there is to it. This will only allow root logins from the local terminal. If you are using a remote X session, you will still not be able to login as root unless you override the AllowRemoteRoot setting. Fortunately, depending on your point of view, Linux does not use anything to neuter the root account.

5 comments:

KiwiGuy said...

I had the same problem with Debian 4, really useful post, thanks.

Nahuel said...

u saved my day!!!! couldnt remember my user name xD so now ill login as root right away xD gdm didnt allow T__T

thx^^

Anonymous said...

I'm using the latest version of Ubuntu studio, and the login manager will not allow any changes, and no changes to the gdm.conf files have any effect.

Looks like somebody has seriously messed with this puppy.

crj

Anonymous said...

some choose to reduce privileges and some to spread wisdom...

Anonymous said...

Thank you!
It works on my BackTrack!

(because i installed gdm)