3

All of a sudden one day my computer required me to log in before going to my desktop. I put in my password, but it didn't work, and when I tried to fix the problem via the command line, the command line wouldn't accept my password either.

I successfully reset the password twice, just to be absolutely sure I was using the correct password, but it still wouldn't accept the new password after it was successfully changed.

The method I used to change the password was:

mount -o remount,rw /
chmod 640 /etc/shadow
sudo passwd USER
  • When correct password is used it returns to this screen

    login screen, loop with correct password

    and when incorrect password is used, it returns to this screen

    login screen, loop with incorrect password

I followed instructions to mount the root file-system/chroot in live cd/usb, and try chroot with strace -o login.strace login to see if I got different results but I didn't. enter image description here

Dpan
  • 31
  • pay attention to keyboard layouts. you might be suffering from not being american or english. I regularly come across this myself. – Phillip -Zyan K Lee- Stockmann Nov 11 '16 at 20:04
  • I checked the layout by entering my password as a command in the command line just so I could see how it came out on the screen, and the password was shown on the screen how it should have been. This makes me think it's not a keyboard layout issue. Also, I had been using the original password for a couple of months but then all of a sudden this password stopped working. – Dpan Nov 12 '16 at 01:47
  • 1
    Another thought that crossed my mind: perhaps it is not your password that is corrupt, but your user account. Have a look at /var/log/auth.log and search for your username. – Phillip -Zyan K Lee- Stockmann Nov 12 '16 at 09:16
  • When I entered /var/log/auth.log , the next line read "bash: /var/log/auth.log: Permission denied" – Dpan Nov 13 '16 at 06:11
  • Most log files are readable only by root. They are text files you need to open with less or some editor of your choice (nano for example). – Phillip -Zyan K Lee- Stockmann Nov 13 '16 at 08:25
  • I don't understand all of what you wrote. I entered the command in the command line that appears after I went into recovery mode and then chose "Root Drop to root shell prompt". Is that what you mean when you say readable by root? In order me to be able to follow, I will need more detailed instructions because there are a lot of things that I don't know about Ubuntu or computers in general. – Dpan Nov 15 '16 at 04:04
  • Can I still get help? – Dpan Nov 17 '16 at 02:03
  • Yes you can, I'm sorry for not answering sooner. This problem of yours will be better solved in a chat or with direct assistance. I would do this, but it seems you are generally far from my time zone. (Its around 4:30 in the morning where I live). Perhaps someone else can step in? – Phillip -Zyan K Lee- Stockmann Nov 17 '16 at 03:39
  • No problem. A chat would be great. If you live in Stockholm, then according to my calculations, you are 10 hours ahead of me. I live in Seattle, WA, USA. I can try to be available sometime when it is convenient for you. Is there a time/day(s) that is better for you to chat? – Dpan Nov 18 '16 at 07:08
  • 1
    @Dpan, I may not much help for you, the login process is new to me. If you have time we may go one by one to debug the problem. You can't login in tty7 (GUI) neither in tty1 (Console), right? But you can still drop to recovery root shell. In recovery shell after remounting / as rw, try login command if can login let me know. If not try again with strace -o login.strace login then upload the login.strace log – user.dz Nov 28 '16 at 11:59
  • I do know that if your password begins with an ! it locks the profile but still allows login with other token ie ssh. That has happened to me because of a friend on 14.04. Anyway...a locked password cannot be changed by its user. To remedy, as root, run [passwd USERNAME -u] to unlock the profile. Then run [passwd USERNAME] to set new password. Good Luck! – Software_Programineer Nov 28 '16 at 21:02
  • @Dapan, can you log into the system from command line? – George Udosen Nov 29 '16 at 07:56
  • @George, no I can't log into the system from the command line. – Dpan Dec 06 '16 at 19:38
  • @user.dz, there are two ways that I can get to a command line. The first is choosing recovery mode while the computer is booting up, then choosing "root Drop to root shell prompt". The second is from the GUI screen when I press ctrl+alt+F3, and once in this mode it reads "Ubuntu 16.04.1 LTS username-Not-Specified tty3" on the first line and "Username-Not-Specified login: " on the second line. If I put any command in, it asks for my password but then when I enter my password (which I know is correct), it reads "Login incorrect" and then "Username-Not-Specified login: " on the line below. – Dpan Dec 06 '16 at 19:56
  • @user.dz, The path to the command line through recovery mode is as follows: Recovery menu- root drop to root shell prompt- Enter (it reads "press enter for maintenance (or press control-D to continue):". After hitting enter it reads "root@usermane-Not-Specified:~#" but any command I enter asks for a password. After I enter the correct password it reads "Login incorrect" in the same way that it does when I get into a command line screen through the GUI screen by hitting ctrl+alt+F3. – Dpan Dec 06 '16 at 20:07
  • @Software_Programineer, no my password doesn't start with "!". I actually reset my password using the method you described and made my password extremely simple after my computer started to wig out like this. My password consist of a lower case letter four times in a row. But, even after successfully changing my password twice, I still run into the same problem. – Dpan Dec 06 '16 at 20:15
  • 1
    @Dpan, Could you update the question instead of comments, such info are important, also the question may get more attention. Follow the instructions in this answer to mount the root file-system/chroot in live cd/usb, but don't run update-grub then after chroot try with strace -o login.strace login see if you get different results. If login.strace created, post it to http://paste.ubuntu.com – user.dz Dec 07 '16 at 09:14
  • @user.dz, I don't know how to update a question, but I'm happy to do that if you tell me how. I'm going to try your suggestion from you last message now. – Dpan Dec 15 '16 at 01:22
  • 1
    @Dpan, Use the small [edit] link under the question post & above the comments (exactly below tags). See https://askubuntu.com/help/editing if you want to learn about its importance. – user.dz Dec 15 '16 at 08:43
  • 1
    @Dpan, I can't see what you are facing. Could you [edit] and include all the output you get, as you are only in recovery, take pictures. – user.dz Dec 17 '16 at 13:01
  • @user.dz, I edited it and posted a picture of the output. – Dpan Dec 27 '16 at 23:59
  • You need to open log files, not execute them, to read them. A simple yet useful command-line text file reading application is less. To open a file foo with it run less foo. – David Foerster Nov 26 '17 at 10:10

0 Answers0