I can use the add-on using a username and password, but when trying to use the authorized_keys, I always get a ‘Server refused our key’.
The debug log shows the following message at the end:
userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
Received disconnect from 192.168.0.111 port 53473:14: No supported authentication methods available [preauth]
Disconnected from authenticating user hassio 192.168.0.111 port 53473 [preauth]
The rsa key I am using seems to be ok, as it is working well to access the system as (real) root using ssh into port 22222.
I have tried several ways/formats to enter the key into the configuration file and restarts of the add-on, and I even tried to manually put the key in the .ssh folder when logged in with username and password, but I keep getting the same error.
I can get where I want using the port 22222 login (and perform a docker exec into the ssh add-on) but I would like to get this sorted out.
Thank you for pointing me into the right direction, both for this issue and for a better place to look first for candidate issues with add-ons in general in the future.
I’ve got the latest (0.77) version of Putty and PuttyGen, and tried creating new ECDSA and EdDSA keys, but still when I try to connect I get the same No supported authentication methods available [preauth] error message, no change.
I did notice that the YAML editor mangles the line breaks in the public key a bit, but since it used to work in the past, I don’t think that’s the problem:
Yay! You nailed it, I was missing the step of converting the public key to OpenSSH format, like you show on your reply. Did that and now all is working again. THANKS!
As for the add-on: I’m using the “Terminal & SSH”) add-on, version 9.6.0
That password was left in the screenshot by mistake, I was testing to see whether it would allow me to connect with a password as a fallback, but it did not (at least not while I had the mangled key in the config). It does not matter much as this is a throwaway test password, but still bad practice, should’ve noticed and scraped it from the image.
@heckler How did you manage to get this working. I can login without keys and just a password but constantly get ‘connection refused’ with any type of key generated from putty. I copy and paste from the right place too. Any thoughts?
Hello @0MartyMcFly0 no problem. I hope it does not sound patronizing (not my intention), but I will spell it out in detail below, might be useful for others facing this issue later:
So I was doing all this because I want to monitor some stats from my NAS through SSH as described in this post by @EventuallyFixed . That means a one line login, no password. I finally got it working with this line…
I’m so happy it’s working. My NAS is an ancient (at least 10 years old) WD My Book World Edition. No integration, no SNMP. So as far as I know, this is the only option. Thanks to @heckler & @EventuallyFixed for the help!
For anyone who runs into this in the future, check your log files. I ran into an issue where my ppk file was too new. The post below goes into detail on the settings that need changing in puttykeygen!
My ssh keys were correct and I tried everything I could think of, I generated new ssh keys with different options -t rsa -b 4096
and
-t ed25519
nothing worked until I commented out those 2 lines that .ssh/config file
The add-on seems to have a bug that reverts to the old key after restarting. Remember to double check that your newly created key is still entered before reconnecting
I do not have the place to feed in the location of the priv key (PuTTY 0.79)
…it is under credentials.
However, it requires (probably) something to be put in the last box, but I don’t have any idea what it is. What ever I try, it just makes this windowslike “ping” sound and does not accept it.
resolved this problem when use a passphrase for generated EdDSA key. Its looks silly, but i put the same phrase into YAML “password” line, and OK. Keys without passphrase dont works.