Possible Duplicate:
How do I add myself back as a sudo user?
How can enable my admin account? i deleted the other one and now the new one is without password and i cant access it and cant do anything with my guest account.
Possible Duplicate:
How do I add myself back as a sudo user?
How can enable my admin account? i deleted the other one and now the new one is without password and i cant access it and cant do anything with my guest account.
This suggestion is based on a previous answer. It assumes you are using Ubuntu 12.04 LTS.
recovery mode
.root (Drop to root shell prompt)
and press enter.mount -o remount,rw /
REPLACE-WITH-USERNAME
to refer to it. Please replace REPLACE-WITH-USERNAME
with your new username which is not working in the commands below.passwd REPLACE-WITH-USERNAME
groups REPLACE-WITH-USERNAME
nopasswdlogin
group, use the command below to remove it from this group.gpasswd --delete REPLACE-WITH-USERNAME nopasswdlogin
groups
command in step (7), use the command below to add it and make it the primary login group for this username.
usermod -g REPLACE-WITH-USERNAME REPLACE-WITH-USERNAME
joeuser
the command would be usermod -g joeuser joeuser
,
)
usermod -a -G adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare REPLACE-WITH-USERNAME
groups
command in step (7) to verify that the username was correctly added to the groups. reboot
sudo fdisk -l
to verify that sudo
is working for you correctly.groups
command from step (7) to verify one last time that the username is a member of the groups it should be in. (Better safe than sorry, no?)
sudo
command allows commands to be executed with root privileges. It is impossible to know the root password - (Techy bit - the password hash stored in/etc/shadow
begins with !, and there is no possible value which can be hashed to get that output) – jackweirdy May 13 '12 at 20:56