Saturday, July 08, 2006

Linux: Getting root In Ubuntu

I came across an issue working with Ubuntu where I couldn't access the root user. I understand that the Ubuntu philosophy is that you primarily use a default user and sudo any privileged commands. This is a great philosophy, however the stubbornness in my wants that root user. Fortunately, there was an easy way for me to get this. In order to get access to the root user account, I ran the following command from a terminal session:

sudo passwd root

Once I entered the User password for my current user, the Unix passwd command came up wanting to know the new password for the root user. I entered the password and was all set. Now I can run su from a command prompt whenever I need to get access to the root account. Some would say this is a bad thing, however i don't like being told I cannot access something on my system. this is one of the reasons I don't buy Cd's anymore, and am moving away from Microsoft for everything except work.

5 comments:

Anonymous said...

I suppose this "I don't like being told I cannot access something on my system.." is the moles counter-aggressiveness towards the innate "go kill'em" attidude of the big system-vendors-carnivores. Haven't we all seen the movie-clip of the now CEO of Microsoft jumping around howling like an ape on dope. Had they been army-officers they would have waged a world war, now they just want to conquer their customers into complete submission. And we resist. We use Linux, and when a Linux-distro try to grey-out an area, some shed light on it. You shed light for me to see by - I'm going to use that neat little trick. I never liked that Ubuntu Sudo-thing either. Thank you.

John Ward said...

I suppose "I don't like being told" isn't exactly the most intelligent reason since Ubuntu seems to be geared as a more user friendly distro, and by gently disuading the use of the root account they are keeping users from shooting themselves in the foot. I understand the principle of general purpose system usage under a non-privalaged account, after all, any exploit on any program, be it Firefox, OO, or whatever would automatically be root, making a hackers job that much easier. That being said, I still like the thought that if I have to do some sort of low level maintenence, be it package installs or whatever, I still like quick access to root. I don't believe that the Ubuntu developers are strong arming us into abondoning root, just disuading us. If they wanted to really make it undesirable, they could have done some nifty rules with SELinux to take the teeth out of the root dog. I'm glad that the tip helped, I've seen the question asked with very few willing to give the answer.

Anonymous said...

And I want some more. I want to be the "root" user all the time, I don't want to use the Terminal.

After setting the root password, how can I actuallly log in as the root user and use the system as such?

Thanks

Fern

John Ward said...

Fern,

I responded to this here.

Anonymous said...

wouldn't it be sufficient to type

sudo su

once? this way you have a root-shell/terminal/whatever without mending with ubuntu's security approach...
on the other hand, it doesn't allow for root-login in gdm...
i, personally am fine with this since gdm with root privileges once killed my whole gentoo insallation:(