-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
  • 2
  • 17
  • 31
  • 1
    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
  • 1
    You don't have to enable the root account to install software. Please read [this community documentation page](https://help.ubuntu.com/community/RootSudo). You may also be interested in [this question](http://askubuntu.com/q/245201/22949). How are you trying to install software? What happens when you try? – Eliah Kagan Mar 16 '13 at 03:59
  • @msw how about some concrete help or pointers instead of cheap punches?. Isn't this what the forum is about? Getting help and helping others? – dot Dec 13 '15 at 14:32
  • @EliahKagan thanks for the useful link. I will take a look – dot Dec 13 '15 at 14:34

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
  • 3
  • 19
  • 32
  • 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