This suggestion is based on a previous answer. It assumes you are using Ubuntu 12.04 LTS.
Boot your computer to the GRUB boot menu. If necessary, press the shift key immediately after booting starts to force the GRUB menu to be displayed.
Select an entry which will boot into
The text graphics menu shown in the image below should appear. Use the up or down arrow key to select an entry.
root (Drop to root shell prompt) and press enter.
The system is currently mounted as read only. Enter the command below to remount your file system as read/write. This allows you to make changes.
mount -o remount,rw /
In your question you said you created a new username which does not have a password. Since I do not know what that new username is, I will use
REPLACE-WITH-USERNAME to refer to it. Please replace
REPLACE-WITH-USERNAME with your new username which is not working in the commands below.
Choose and create a password for this username with the command below.
Use the command below to list all the groups this username is currently a member of.
If step (7) shows that the username is a member of the
nopasswdlogin group, use the command below to remove it from this group.
gpasswd --delete REPLACE-WITH-USERNAME nopasswdlogin
In the unlikely event that you do not see the username itself listed in the output from the
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
Note: Yes, the username is repeated twice. For example, if the username were
joeuser the command would be
usermod -g joeuser joeuser
Use the command below to ensure the username is in all the default groups it should be. Note: Do not add spaces between the commas (
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.
Restart your system with the command below. (It can take a few seconds. Wait for it ...)
Login using the password you chose for the username in step (6).
- I suggest also trying, for example,
sudo fdisk -l to verify that
sudo is working for you correctly.
- I would also retry the
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?)