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 Answer
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
-
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– AserreAug 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'. Aug 6, 2014 at 16:24