How to login ssh without a password using the ssh host key?

14,916

Solution 1

In short: You can't. A host key isn't a thing you can exploit to get into a server - it's just a cryptographic hash of the server's public key. It's public, so there's nothing to break.

SSH transmits this to clients so they can ensure they're talking to the right server.

More information here.

Solution 2

The quick answer is: you can't because host keys are for making your client sure it's talking to the box you want it to. It does not authenticate/identify you.

The other answer is: just think about it that (almost) anybody can get that host key you have already got. If it should be enough to login, then ssh would be the worst remote login solution ever. And it's not.

Share:
14,916
hien nguyen
Author by

hien nguyen

Updated on September 18, 2022

Comments

  • hien nguyen
    hien nguyen over 1 year

    I want to login to this machine, but I just have an ssh host key, not a password.

    Example from nmap:

    |   1024 b6:00:e3:71:8c:a3:4e:e4:8b:9a:b5:c2:68:86:de:82 (DSA)
    |_  2048 56:7b:96:50:57:7c:3d:e2:21:1d:3c:a2:24:08:58:16 (RSA).
    

    (This key is not created by my machine, it's being picked up on an nmap scan)

    So, how can I login via ssh just with that?