I have a multiple Linux hosts(virtualization) to which I can login as root on only one of the host with ssh root@host with ssh key setup(id_rsa.pub and authorized keys). I don't have this setup on other Linux hosts on the same cluster. I have the access to a salted hash of the root password. I tried multiple ways like hashcat to decrypt the hash but none was successful.

Is there a way to decrypt the hash so that I can recover the root password or is there a way that I can have the same configuration of keys for other Linux hosts on the cluster?


The "hashes" used for Linux passwords are not symmetrical, meaning, they cannot go backwards. You would have to spend your time trying to bruteforcing it.

You are much better off getting the passwords reset in single user mode. After doing that, you can ensure each server's root account has the authorized_keys as needed.


If there was an efficient way to recover a password from its hash, it wouldn't be an efficient way to store passwords ! The purpose of a cryptographic hash is to be hard to reverse.

If you're on a cloud platform, you generally have the option to change root's password or upload a SSH key for the root user that would allow you to recover the access.

If you're not on a cloud platform but on a local VM, you can boot on a live image, chroot on your disk and change root's password.

You can also try very hard to remember if you authorized the key of another user to connect to this root account with SSH without password. Or with some luck, you may have given large sudo permissions to a user that could execute sudo -i or sudo su or sudo bash which would save you ...

If you have no privileged access to the VM and no loophole in your configuration, then you're screwed ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.