-1

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!!

dot
  • 535

1 Answers1

0

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!!!

Nil
  • 1,006
  • 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 03:08