Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 2183  / 3 Years ago, wed, september 8, 2021, 1:29:10

After trying to change my password with usermod -p <new password> <username>
( which seemed to work but didn't give any messages ) I found I could not log in using either my old or new password. From what I've read it looks like maybe this is due to usermod expecting the password given to be encrypted?



How can I get back in?


More From » 12.10

 Answers
6

Yes, this problem happened because usermod -p expected the password hash (i.e., the encrypted password), not the cleartext password.



From man 8 usermod:




-p, --password PASSWORD



The encrypted password, as returned by crypt.



Note: This option is not recommended because the password (or
encrypted password) will be visible by users listing the processes.



The password will be written in the local
/etc/passwd or /etc/shadow
file. This might differ from the password database configured in your
PAM configuration.



You should make sure the password respects the system's password
policy.




You can get back in the same way you would if you lost the administrator password under any other conditions.



If you have an administrator account, and it's not the account you specified as <username>, you can get it back by changing the password in the usual way:



sudo passwd <username>

[#33236] Wednesday, September 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fishutt

Total Points: 391
Total Questions: 137
Total Answers: 106

Location: Mexico
Member since Tue, Aug 11, 2020
4 Years ago
fishutt questions
Thu, Nov 17, 22, 07:36, 2 Years ago
Mon, Mar 28, 22, 15:09, 2 Years ago
Wed, Feb 8, 23, 06:50, 1 Year ago
Thu, Aug 25, 22, 13:26, 2 Years ago
Fri, Apr 22, 22, 00:08, 2 Years ago
;