SeLLeRoNe
Super Moderator
Tested, everything worked fine and user can still log with old password that was set on CentOS 5.8.
Regards
Regards
Tested, everything worked fine and user can still log with old password that was set on CentOS 5.8.
Regards
# Use MD5 or DES to encrypt password? Red Hat use MD5 by default.
MD5_CRYPT_ENAB yes
ENCRYPT_METHOD MD5
# Use MD5 or DES to encrypt password? Red Hat use MD5 by default.
MD5_CRYPT_ENAB yes
# Use SHA512 to encrypt password.
ENCRYPT_METHOD SHA512
# Use MD5 or DES to encrypt password? Red Hat use MD5 by default.
MD5_CRYPT_ENAB no
ENCRYPT_METHOD SHA512
In other words: the Directadmin interface did not reflect the real situation. Turning SSH access off, wait for a minute and turning SSH on solved the issue.
I tried it the other way around. Create a fresh Centos 5 server, check that the admin had SSH access, restore a backup of my Centos 6 server. All users that had SSH access were restored with SSH access except admin.The fact that SSH access was not restored might be a bug. So if you could test it once more and replicate it again, then I'd guess it should be reported to Directadmin staff.
AllowUsers admin
[root@vps ~]# passwd --status admin
admin PS 2014-07-31 0 99999 7 -1 (Password set, SHA512 crypt.)
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-01 0 99999 7 -1 (Password set, MD5 crypt.)
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-01 0 99999 7 -1 (Password set, SHA512 crypt.)
[root@vps2 ~]# tail -n8 /etc/ssh/sshd_config
# ForceCommand cvs server
AllowUsers root
AllowUsers jane
AllowUsers tammo
AllowUsers limedev
AllowUsers modx
AllowUsers peteremil
AllowUsers admin
[root@vps2 ~]# ssh admin@localhost
admin@localhost's password:
Last login: Fri Aug 1 11:32:22 2014 from localhost
[admin@vps2 ~]$ exit
logout
Connection to localhost closed.
[root@vps2 ~]#
[root@vps2 ~]# tail -n8 /etc/ssh/sshd_config
# AllowTcpForwarding no
# ForceCommand cvs server
AllowUsers root
AllowUsers jane
AllowUsers tammo
AllowUsers limedev
AllowUsers modx
AllowUsers peteremil
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-01 0 99999 7 -1 (Password set, MD5 crypt.)
[root@vps2 ~]# ssh admin@localhost
admin@localhost's password:
Permission denied, please try again.
admin@localhost's password:
[root@vps2 ~]#
[root@vps2 ~]# ssh admin@localhost
admin@localhost's password:
Last login: Fri Aug 1 15:42:38 2014 from localhost
[admin@vps2 ~]$ exit
logout
Connection to localhost closed.
[root@vps2 ~]# tail -n8 /etc/ssh/sshd_config
# ForceCommand cvs server
AllowUsers root
AllowUsers jane
AllowUsers tammo
AllowUsers limedev
AllowUsers modx
AllowUsers peteremil
AllowUsers admin
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-01 0 99999 7 -1 (Password set, SHA512 crypt.)
[root@vps2 ~]#
[root@vps2 ~]# echo restoring
restoring
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-02 0 99999 7 -1 (Password set, MD5 crypt.)
[root@vps2 ~]# tail -n8 /etc/ssh/sshd_config
# AllowTcpForwarding no
# ForceCommand cvs server
AllowUsers root
AllowUsers jane
AllowUsers tammo
AllowUsers limedev
AllowUsers modx
AllowUsers peteremil
[root@vps2 ~]# ssh admin@localhost
admin@localhost's password:
Permission denied, please try again.
admin@localhost's password:
[root@vps2 ~]# echo Putting admin's SSH access off and on in DA-interface
> ^C
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-02 0 99999 7 -1 (Password set, MD5 crypt.)
[root@vps2 ~]# tail -n8 /etc/ssh/sshd_config
# ForceCommand cvs server
AllowUsers root
AllowUsers jane
AllowUsers tammo
AllowUsers limedev
AllowUsers modx
AllowUsers peteremil
AllowUsers admin
[root@vps2 ~]# ssh admin@localhost
admin@localhost's password:
Last login: Sat Aug 2 15:47:27 2014 from localhost
[admin@vps2 ~]$exit
Connection to localhost closed.
[root@vps2 ~]# authconfig --test | grep hashing
password hashing algorithm is sha512
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-02 0 99999 7 -1 (Password set, MD5 crypt.)
[root@vps2 ~]#
[root@vps2 ~]# echo Rebooting while keeping the telnet session open
Rebooting while keeping the telnet session open
[root@vps2 ~]#
[root@vps2 ~]# authconfig --test | grep hashing
password hashing algorithm is sha512
[root@vps2 ~]# echo just to be sure
just to be sure
[root@vps2 ~]# authconfig --passalgo=sha512 --update
[root@vps2 ~]# authconfig --test | grep hashing
password hashing algorithm is sha512
[root@vps2 ~]# tail -n8 /etc/ssh/sshd_config
# ForceCommand cvs server
AllowUsers root
AllowUsers jane
AllowUsers tammo
AllowUsers limedev
AllowUsers modx
AllowUsers peteremil
AllowUsers admin
[root@vps2 ~]#
[root@vps2 ~]# echo restoring the same backup once again...
restoring the same backup once again...
[root@vps2 ~]#
[root@vps2 ~]# tail -n8 /etc/ssh/sshd_config
# AllowTcpForwarding no
# ForceCommand cvs server
AllowUsers root
AllowUsers jane
AllowUsers tammo
AllowUsers limedev
AllowUsers modx
AllowUsers peteremil
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-02 0 99999 7 -1 (Password set, MD5 crypt.)
[root@vps2 ~]# authconfig --test | grep hashing
password hashing algorithm is sha512
[root@vps2 ~]#
I checked this once again with a backup made on the testserver it self. How on earth can Directadmin change a SHA512 hashed password into a MD5 hashed password without having stored the password in plain text somewhere? Unedited telnet session below. Please note the change in the hash of the password in /etc/shadow.Complete and unedited telnet session below. Short summery: the backup was from a server with default hashing method SHA512 and the admin password was also SHA512. The admin had SSH access. The server where the restore was done, had the same specs.
After the restore the admin had lost the SSH access (although the DA interface did not reflect that). On top of that the admin password was MD5 hashed now! I can not think of any method to do that unless you have the password in plain text. I surely do hope Directadmin does no such thing.
[root@vps2 ~]# tail /etc/ssh/sshd_config
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
AllowUsers root
AllowUsers jane
AllowUsers tammo
AllowUsers modx
AllowUsers peteremil
AllowUsers limedev
AllowUsers admin
[root@vps2 ~]# authconfig --test | grep hashing
password hashing algorithm is sha512
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-03 0 99999 7 -1 (Password set, SHA512 crypt.)
[root@vps2 ~]# cat /etc/shadow | grep admin
admin:$6$FljEOEP9$lN26IInicx0.QnnAEN7wNpX9n00u1iMVWIhrk.RiMs60b6Im7FAHhUlgDF8B3fMMSwGXsvMhaAf4FAZbNKXEx/:16285:0:99999:7:::
diradmin:!!:16031::::::
[root@vps2 ~]#
[root@vps2 ~]# echo Making a backup
Making a backup
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-03 0 99999 7 -1 (Password set, SHA512 crypt.)
[root@vps2 ~]# cat /etc/shadow | grep admin
admin:$6$FljEOEP9$lN26IInicx0.QnnAEN7wNpX9n00u1iMVWIhrk.RiMs60b6Im7FAHhUlgDF8B3fMMSwGXsvMhaAf4FAZbNKXEx/:16285:0:99999:7:::
diradmin:!!:16031::::::
[root@vps2 ~]#
[root@vps2 ~]# echo Restoring the backup
Restoring the backup
[root@vps2 ~]# echo Restored, let us check
Restored, let us check
[root@vps2 ~]# passwd --status admin
admin PS 2014-08-06 0 99999 7 -1 (Password set, MD5 crypt.)
[root@vps2 ~]# cat /etc/shadow | grep admin
admin:$1$VA5n3HVL$gxjuOFZwrX7ViBCKmzMdr/:16288:0:99999:7:::
diradmin:!!:16031::::::
[root@vps2 ~]# tail -n8 /etc/ssh/sshd_config
# AllowTcpForwarding no
# ForceCommand cvs server
AllowUsers root
AllowUsers jane
AllowUsers tammo
AllowUsers modx
AllowUsers peteremil
AllowUsers limedev
[root@vps2 ~]# echo Put the SSH access foradmin off and on in the DA interface
Put the SSH access foradmin off and on in the DA interface
[root@vps2 ~]# tail -n2 /etc/ssh/sshd_config
AllowUsers limedev
AllowUsers admin
[root@vps2 ~]# echo Log in with the password that has been SHA512 hashed
Log in with the password that has been SHA512 hashed
[root@vps2 ~]# ssh admin@localhost
admin@localhost's password:
Last login: Thu Jul 31 15:14:52 2014 from localhost
[admin@vps2 ~]$