Summary: How This Problem Has Developed
So far, this problem appears to have progressed through two stages.
First, it was not possible to log in at all, on the graphical login screen. It was possible to log in on a virtual console. Information obtained in a virtual console indicated that:
- The output of
df -h shows there's plenty of free space available. Graphical login has been known to fail when there is zero or very little free space on the hard disk, but that is apparently not what's wrong here.
- The output of
dpkg -l | egrep 'lightdm|gdm|kdm|lxdm' shows that the only display manager (which provides the login screen) installed is LightDM. This information was valuable because a potential solution to being unable to log in could have been to try a different display manager (for example, by installing and switching to
- When changing the password, you said "had to do the mount remount thing first but it said the password was successfully changed after that." That suggests to me that you actually changed the password by booting into recovery mode, and not on the virtual console. If I am mistaken about this assumption, please let me know.
Now, you can log in, presumably by entering your username and password at the graphical login screen. (Please make sure to let me know if this is not correct.) However, you cannot authenticate after logging in. Therefore:
- Changing the password appears to have fixed part of the problem. I'm guessing the password either had not been set properly during installation (perhaps due to some bug), or it contained characters that for some reason LightDM is unable to handle on its login screen, or it contained characters that mapped to different keys on your keyboard during installation than they did on the LightDM login screen. With your new password, you can log in.
- However, the problem is not entirely fixed, because you cannot authenticate after logging in. I have preserved the general information I presented as my original answer in the first section below, entitled Password Doesn't Work On Login Screen. That information may be useful to other people who experience similar problems. Please skip down to the section called Can Log In, But Other Authentication Fails.
Password Doesn't Work On Login Screen
A few things to check:
- Is Caps Lock on?
- Similarly, if you're using the numeric keypad to enter some of the characters, is Num Lock on?
- Does your password contain unusual characters? (Perhaps you've found a weird bug.) Have you tried different passwords?
- Did you set your password with a different keyboard layout from the one you're using to authenticate with it? If so, you may be typing in a totally different password.
- Is your password blank (i.e., the zero character long password)? This doesn't work properly; you need to have an actual password.
Maybe something is systematically going wrong during the installation process. If you started with an Ubuntu ISO image, then:
It's common for a bad ISO or a bad burn/write to prevent installation from succeeding, but it is also possible to get a broken installation.
As for fixing this:
You have a Wubi system*, so GRUB runs after the Windows boot loader. Select Ubuntu on the screen where Windows and Ubuntu are you two choices, then press Shift and hold it down, then press Enter. This way, the Shift key is being pressed as the Windows boot loader chain-loads GRUB.
- *Edit: Actually, it turns out (from information you've since provided) that you do not have a Wubi system. I'm not sure why holding down Shift doesn't work for you. Since the above advice applies whenever any boot loader besides GRUB chain-loads into the Ubuntu system's GRUB boot loader, it may work (or have worked) for you still. Otherwise, the problem could be that you are not holding down the Shift key early enough in the boot process, or that you are releasing it too soon.
It's possible that this is, somehow, a problem with the graphical login screen. So you might be able to log in successfully from a text-based virtual console. To attempt that, boot the Ubuntu system, then after the graphical login screen comes up (or, even when you're logged in graphically as guest), press Ctrl+Alt+F1. Enter your username and press Enter. Then put in your password and press Enter. (You won't see anything happening as you enter your password but that's normal.)
If you can log in to a virtual console, try changing your password by running the command
passwd. If that doesn't work or you still can't log in graphically, try changing it by running the command
sudo passwd $USER.
Can Log In, But Other Authentication Fails
This section assumes that you now are able to log in as the user created during setup, using the graphical login screen. That is to say that you can use your Ubuntu system via graphical user interface, not just as guest, but also as the user created during setup. If I have misunderstood, please let me know.
You're able to log in now, but once you're logged in, you can't authenticate. There are three main types of authentication that are performed after logging in:
Authentication to perform administrative tasks. You are asked for a password when you try to perform actions that cannot be accomplished by an ordinary, unprivileged user, like installing software or changing system files. For this, you use the same password as you use to log in. Such authentication will only succeed if you are an administrator on the system. I am assuming this is the kind of authentication that is currently failing. Please let me know if my assumption is incorrect.
Authentication to unlock the screen. You can manually lock the screen, or you can configure the screen saver to lock it. It may also be locked when resuming from sleep (suspend-to-RAM) or hibernation (suspend-to-disk). For this, you also use the same password as you use to log in.
Authentication to unlock your keyring. The keyring may be used to store passwords (for example, for Internet services) or other sensitive data. Your keyring password is not necessarily the same as the password you use to log in. Unlike your login password, my understanding is that the keyring password can be blank, without causing problems.
The things to check for problems authenticating while logged in (whether to perform administrative tasks, unlock the screen, or unlock the keyring) are largely the same as for being unable to log in: Points 1-4 under Password Doesn't Work On Login Screen apply (except that point 4 doesn't apply to keyring passwords).
But I'm guessing you've already considered that. So, let's focus on problems specific to logging in to perform administrative tasks. These are the things to check. (Please note that this is long because it provides some instructions for fixing the problem, under some circumstances. Actually checking these things, generally speaking, is not particularly difficult or time-consuming.)
Are you actually an administrator?
Open a Terminal window (Ctrl+Alt+T) and run this command:
That lists the groups your user account is a member of. To be an administrator,
sudo (or both) must be listed. Please note that
adm is a different group from
admin and doesn't make you an administrator (though you should also be a member of that group).
If you're not an administrator, you can make yourself one by following any procedure for resetting a lost password (typically you'd use recovery mode for this, but single user mode via editing GRUB boot options, or
chrooting from a live CD/DVD/USB, will also work). Except instead of running the
passwd username command, run these commands:
usermod -a -G admin username
usermod -a -G sudo username
It's fine if one (but not both) of those commands fails. (If it fails, you get an error message. If it succeeds, there's generally no output.) What that does is to put you into whichever of the
sudo groups exist (or both, if they both exist).
Are only some ways of authenticating to perform administrative tasks broken?
Ubuntu actually provides two underlying mechanisms for administrators to authenticate to perform administrative tasks--
sudo (which has graphical frontends such as
kdesudo), and PolicyKit.
In a Terminal window, run this command, to test PolicyKit:
pkexec echo Success.
You should be prompted for your password (probably by a graphical dialog box, but possibly in the Terminal window). If authentication succeeds and the word
Success. is echoed back to you (i.e., printed in the Terminal), then PolicyKit works for performing administrative tasks (though it's possible it's still not working, for specific tasks).
Now run this command:
sudo echo Success.
sudo in the same way (though the authentication will definitely be in the Terminal window--you won't get a graphical dialog box asking for your password).
Now run this command, to see if
sudo is working graphically (run this even if
sudo didn't work above, in case the problem has to do with the way the Terminal accepts input):
You'll be prompted for your password. If that succeeds, a simple clock application will run. (You can quit the clock application.) If that fails, run this to see if the problem is that
gksu is not configured properly:
If this is a Kubuntu system, then you will probably not have the
gksudo utilities, so test with the
kdesudo utility instead:
pkexec works but
sudo and also
kdesudo) don't work:
sudo's configuration is broken, or
sudo itself is broken. The former is more common, and easier to fix--I'll cover that here. (You'd know if
sudo itself is broken because you'd get an error about how it refuses to run due to incorrect ownership/permissions, or an error saying
command not found.)
pkexec visudo to edit
sudo's main configuration file. Near the end of the file, you should see something like this:
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
- If you're running a version of Ubuntu earlier than 12.04, don't worry about the
- If you're running Ubuntu 12.04 and later and you did not upgrade from a version of Ubuntu earlier than 12.04, don't worry about the
%admin line (it might not even be present at all).
%sudo lines (see above two bullet points) should be uncommented--that is, should not start with a
%sudo, there should be a space, followed by
ALL=(ALL) ALL or
If things are not as described above, you can edit the file to fix them. Since you're using the
visudo utility to edit the file, it will catch syntax errors when you try to save the file. You should not attempt to override and save a file that it says has syntax errors. (
sudo, and its graphical frontends, will refuse to work if the
sudoers file contains even a single syntax error.)
If everything appears to be in order in your
sudoers file, try reinstalling
sudo. Assuming you haven't customized your
sudoers file, reinstall
sudo by running this command:
pkexec apt-get update
pkexec apt-get --purge --reinstall install sudo
However, if you have customized your
sudoers file (before this--I don't mean the editing described above) and it's important to you that you not lose the customizations, leave off the
pkexex apt-get update
pkexec apt-get --reinstall install sudo
gksudo work, but
gksu doesn't work:
Run the command
gksu-properties (this does not need to be run as
root, i.e., don't run it with
gksudo). Make sure Authentication mode is set to sudo and not su.
Source: Password not working in Graphical Applications (gksu)? Works with sudo (Has a screenshot.)
sudo work, but
kdesudo) don't work:
gksudo (they're provided by the same package):
pkexec apt-get update
pkexec apt-get --purge --reinstall install gksu
Or if this is Kubuntu and it's
kdesudo that's not working:
pkexec apt-get update
pkexec apt-get --purge --reinstall install kdesudo
pkexec doesn't work, but
gksudo do work:
Try reinstalling PolicyKit:
sudo apt-get update
sudo apt-get --purge --reinstall install policykit-1 libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0
pkexec works, and
kdesudo) work, but
sudo doesn't work:
pkexec usually authenticates graphically, like
kdesudo on Kubuntu). So if graphical authentication is working for both PolicyKit and
sudo-based methods, and console authentication is failing, there may be a problem with the way passwords are being entered into the Terminal. I've heard of this happening, but I'm not familiar with any concrete cases where it was known to occur and was then fixed. (Except where it was due to the user making a mistake entering the password in the Terminal.)
If this is happening, then to provide further information:
- See if
sudo works in a virtual console (Ctrl+Alt+F1). This can help figure out if it's the graphical terminal application causing the problem.
- See if
pkexec works in a virtual console. When run in a virtual console,
pkexec will not create a graphical dialog box. This can help figure out if the problem is also specific to
- See if
su $USER works, in both a Terminal window and in a virtual console. This command does not enable you to perform administrative tasks. It just authenticates as yourself. But it asks for a password (non-graphically) while doing so. This can help figure out the extent of the problem entering passwords to authenticate non-graphically.
- the situation is different from all the combinations listed above, or
- the situation is one of the combinations listed above, but there's a problem following the instructions, or
- the situation is one of the combinations listed above and you've followed the instructions without apparent problems, but the underlying problem (of being unable to authenticate) has not gone away...
Then please edit your question to provide details, and also comment here (with or without
@Eliah--when you comment on my answer, I'm always notified) to let me know.