[Reproducible bug] admin backup restoration will not use previous password changed via terminal

MaXi32

Verified User
Joined
Jul 25, 2016
Messages
658
Location
The Earth
EDIT:

Found the reason, go to 2nd post. Title changed
===============

This is hard to understand what I did wrong, I tried to restore the admin backup (replacing the existing backup), and after I restored the backup I could not log in using the old admin password. The backup was restored successfully with no error it is just that I could not log in even I knew I had supplied the correct password. So, I have to change the password manually in the terminal like:

passwd admin

The backup is working well when restoring other users (password is ok) it is just if I restore the main admin user and replace its own files.


What I mean is, the problem only occurred when I do this replacement for admin current login in this picture:

1635478907840.png


̶i̶s̶ ̶i̶t̶ ̶p̶o̶s̶s̶i̶b̶l̶e̶ ̶t̶h̶a̶t̶ ̶t̶h̶e̶ ̶r̶e̶s̶t̶o̶r̶a̶t̶i̶o̶n̶ ̶o̶f̶ ̶t̶h̶e̶ ̶e̶x̶i̶s̶t̶i̶n̶g̶ ̶m̶a̶i̶n̶ ̶a̶d̶m̶i̶n̶ ̶u̶s̶e̶r̶ ̶w̶i̶l̶l̶ ̶u̶s̶e̶ ̶a̶ ̶r̶a̶n̶d̶o̶m̶ ̶p̶a̶s̶s̶w̶o̶r̶d̶ ̶a̶f̶t̶e̶r̶ ̶b̶e̶i̶n̶g̶ ̶r̶e̶s̶t̶o̶r̶e̶d̶?̶ ̶[̶U̶S̶E̶R̶=̶5̶9̶8̶2̶]̶@̶s̶m̶t̶a̶l̶k̶[̶/̶U̶S̶E̶R̶]̶

̶E̶D̶I̶T̶:̶ ̶J̶u̶s̶t̶ ̶n̶o̶w̶ ̶I̶ ̶t̶r̶i̶e̶d̶ ̶o̶n̶ ̶t̶h̶e̶ ̶n̶e̶w̶ ̶s̶e̶r̶v̶e̶r̶.̶ ̶I̶ ̶c̶o̶u̶l̶d̶ ̶n̶o̶t̶ ̶r̶e̶p̶r̶o̶d̶u̶c̶e̶ ̶t̶h̶i̶s̶ ̶o̶n̶ ̶t̶h̶e̶ ̶n̶e̶w̶ ̶i̶n̶s̶t̶a̶l̶l̶ ̶(̶b̶u̶t̶ ̶I̶ ̶w̶i̶l̶l̶ ̶i̶n̶s̶p̶e̶c̶t̶ ̶t̶h̶i̶s̶ ̶i̶s̶s̶u̶e̶,̶ ̶l̶i̶k̶e̶ ̶m̶a̶y̶b̶e̶ ̶h̶a̶v̶i̶n̶g̶ ̶u̶s̶e̶r̶n̶a̶m̶e̶ ̶o̶t̶h̶e̶r̶ ̶t̶h̶a̶n̶ ̶a̶d̶m̶i̶n̶ ̶o̶r̶ ̶u̶s̶i̶n̶g̶ ̶s̶o̶m̶e̶ ̶k̶i̶n̶d̶ ̶o̶f̶ ̶c̶h̶a̶r̶a̶c̶t̶e̶r̶ ̶i̶n̶ ̶p̶a̶s̶s̶w̶o̶r̶d̶)̶
 
Last edited:
@smtalk @fln I found the reason (post marked as a confirmed bug). It would take less than 2 minutes to reproduce:

I use the old and popular method recommended in this forum to change the password for default admin via the terminal (maybe I should not use this anymore). Example this method:

Code:
passwd admin

password:

So, if you change the admin password in the terminal like above, and when you do admin backup, it will not store the latest password that you provided above but if you changed the password through GUI the backup will store the latest password. I believe this affects all users' backups too.

Then, if you restore the backup from the above after you have changed password via terminal, it will log you out and you cannot use the latest password with this error message:

Code:
Hmm, login details do not seem to be correct. Please try again.Sign in


So, you need to use the oldest password that you had before you changed it via terminal to successfully login. That explains why the old password was not restored. I will move my script to use API to change admin password. The method above is not safe anymore as you have ever recommended this once: https://forum.directadmin.com/threads/directadmin-lost-password.23664/post-122315

So, the workaround to this problem is, after I have changed admin password via terminal (in case password is lost), I need to re-enter the same password via GUI in order for the backup to store the latest password.
 
Last edited:
Back
Top