Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just installed ubuntu on my netbook and am loving it!!

What I’m now trying to do is set up my root account. I tried to run the following command at a command prompt:

su root

and use the password for the main account i set up during the install process. but that didn't work.

so then i tried

"sudo password root"

in an attempt to change the root password, but i get the following error message:

 cp@cp-AOA150:~$ sudo password root
 sudo: password: command not found

any suggestions on how i can fix this?
i need to start installing tools like apache2 but i can't without being root.... thanks!!

share|improve this question
    
Do you mean to execute passwd? You should try to avoid using the root account - executing specific commands with sudo is a much safer approach. –  Moshe Mar 15 '13 at 21:55
    
You don't have to enable the root account to install software. Please read this community documentation page. You may also be interested in this question. How are you trying to install software? What happens when you try? –  Eliah Kagan Mar 16 '13 at 3:59

1 Answer 1

Well, I know I shouldn't be putting this out in the open, but to log in as a root user you use the command su. Notice that I didn't give it a username? It's not recommended that you log in as a root user since you can easily mess up your computer, so Ubuntu forbids anyone except the root user from logging in as the root user.

Instead, if you need to run any commands as a root user you use the 'sudo' command followed by whatever your trying to do. Now, here's the how you log in as root. NEVER DO IT, but I'll tell you anyway. Since the root user can only log in as the root (huh? That's circular, how does that even work?), you can use sudo to become root. i.e. sudo su. But don't do this, even though I just told you how.

Now, the password for root is the same as the password on your user account (assuming it has administrator priviledges). So really all you need to do is change your regular password with passwd.

Now, this is the important part. Forget everything I told you about sudo su!!!

share|improve this answer
1  
sudo su doesn't log in as root; it simply runs su as root via sudo. The effect is simply to run a shell as root. And it's not true that one should never do this--there are circumstances where this makes a lot of sense. In fact, sudo contains a built-in mechanism for this. sudo -s is equivalent to su and sudo -i is equivalent to su -. –  Eliah Kagan Mar 16 '13 at 3:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.