0

I have installed Ubuntu 14.04 LTS . During installation on my Windows PC using VMWARE Player, it asked a username and I provided one. But now after successful installation, I also want to login as the root user. But unfortunately I don't know how to retrieve the root password or change it. How can I log in as the root user?

1
  • 3
    Read all the answers here How to enable root login? first. Enabling root is never necessary and is not a good idea a number of the answers there explain why. If you still want to enable root that's answered too. Aug 6, 2014 at 13:14

1 Answer 1

-2

If you lose control of root:

Before you format again, check /etc/passwd, e.g.,

gvim /etc/passwd 

you should see a line like

root:x:0:0:root:/root:/bin/csh

sometimes this gets incorrectly modified, e.g.:

root:x:0:0:root:/root:csh

Essentially the system cannot find the location of the installed shell from where to invoke root. Correct it!

You should have root access back!

use the following method to give yourself permission to modify that file.

sudo adduser <username> www-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rw /var/www
2
  • This does not provide a solution to the problem, but adresses a very specific issue merely related to OP's problem. Furthermore adding a new user won't do anything with the root acount
    – Aserre
    Aug 6, 2014 at 15:16
  • Hello, I have tried the same but I got below error while executing "sudo chown -R www-data:www-data /var/www": chown :cacnot access 'var/www': no such file or directory. further I have checked that there is no 'www' directory under 'var'.
    – user165062
    Aug 6, 2014 at 16:24

Not the answer you're looking for? Browse other questions tagged .