I installed Ubuntu on an old XP machine (replaced XP with Ubuntu) and it seemed like it went well… Until I tried to download and install the suggested updates!
The password I set during installation will not work for authentication. It won't even work for the User account. I thought maybe I'd typed the password wrong (twice) and checked online how to change it. Holding shift during start up won't give me boot options or grub so I can't get into recovery mode!
I've reinstalled three times (twice with the CD, once with the usb) and it's the same deal.
Basically, I'm sure I typed the password correctly, so I severely doubt that changing the password will help. It will automatically log in if I set it to do so during installation. Otherwise, I can only use the guest account and obviously can't setup another account or update software.
This is my first experience with Ubuntu and until it asked for the password, I thought it had gone so well. I sincerely hope I've missed something simple and I can get this working properly.
I'm surprised that I haven't found any questions with exactly the same issue. Please help! 🙂
Requested information
1: df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 147G 4.7G 135G 4% /
udev 1000M 4.0K 1000M 1% /dev
tmpfs 403M 836K 402M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1007M 176K 1007M 1% /run/shm
/dev/sdc1 7.5G 4.7G 2.8G 63% /media/PENDRIVE
patricia@[computer name removed by me just in case it shouldn't be shared]
2: dpkg -l | egrep 'lightdm|gdm|kdm|lxdm'
ii liblightdm-gobject-1-0 1.2.1-0ubuntu1 LightDM GObject client library
ii lightdm 1.2.1-0ubuntu1 Display Manager
3: Regarding whether or not there were error messages when logging in to a virtual console and attempting to change the password with passwd
and sudo passwd $USER
:
- No, I had to do the mount remount thing first but it said the password was successfully changed after that. It also tells me that I've successfully logged in…
New development:
I can now login to the user account created during setup…. I still can't use that password to authenticate though!
Hopefully we're getting closer.. Thanks so much for all your help 🙂
Best Answer
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:
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.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 togdm
).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:
Password Doesn't Work On Login Screen
A few things to check:
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.
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 commandsudo 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,
admin
orsudo
(or both) must be listed. Please note thatadm
is a different group fromadmin
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
chroot
ing from a live CD/DVD/USB, will also work). Except instead of running thepasswd username
command, run these commands: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
admin
orsudo
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 asgksu
/gksudo
andkdesudo
), and PolicyKit.In a Terminal window, run this command, to test PolicyKit:
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:
This tests
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 ifsudo
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
gksu
andgksudo
utilities, so test with thekdesudo
utility instead:If
pkexec
works butsudo
and alsogksu
andgksudo
(orkdesudo
) don't work:Either
sudo
's configuration is broken, orsudo
itself is broken. The former is more common, and easier to fix--I'll cover that here. (You'd know ifsudo
itself is broken because you'd get an error about how it refuses to run due to incorrect ownership/permissions, or an error sayingcommand not found
.)Run
pkexec visudo
to edit/etc/sudoers
,sudo
's main configuration file. Near the end of the file, you should see something like this:%sudo
line.%admin
line (it might not even be present at all).The
%admin
and/or%sudo
lines (see above two bullet points) should be uncommented--that is, should not start with a#
character.After
%admin
and/or%sudo
, there should be a space, followed byALL=(ALL) ALL
orALL=(ALL:ALL) ALL
.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 thesudoers
file contains even a single syntax error.)If everything appears to be in order in your
sudoers
file, try reinstallingsudo
. Assuming you haven't customized yoursudoers
file, reinstallsudo
by running this command: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--purge
flag:If
pkexec
,sudo
, andgksudo
work, butgksu
doesn't work:Run the command
gksu-properties
(this does not need to be run asroot
, i.e., don't run it withpkexec
,sudo
, orgksudo
). 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.)
If
pkexec
andsudo
work, butgksu
andgksudo
(orkdesudo
) don't work:Try reinstalling
gksu
/gksudo
(they're provided by the same package):Or if this is Kubuntu and it's
kdesudo
that's not working:If
pkexec
doesn't work, butsudo
,gksu
, andgksudo
do work:Try reinstalling PolicyKit:
If
pkexec
works, andgksu
andgksudo
(orkdesudo
) work, butsudo
doesn't work:pkexec
usually authenticates graphically, likegksu
/gksudo
(orkdesudo
on Kubuntu). So if graphical authentication is working for both PolicyKit andsudo
-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:
sudo
works in a virtual console (Ctrl+Alt+F1). This can help figure out if it's the graphical terminal application causing the problem.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 tosudo
-based methods.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.If:
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.