Ssh: connect to host hassio.local port 22: Connection refused

Ah… so @flamingm0e and I posted about the same time, and he references yet another SSH option. So, first, you need to specify which one you’re trying to use. That one does use “root” as the username, so if that’s what you’re using ignore the config for the one I mentioned.

Or uninstall that one, and install the one I linked to.

Its a case of so many options they can be confusing.

Hassio is limited. To get to the host OS, you have to use port 22222. If you have the SSH add-on then you connect to a container that ties into the home assistant container. There aren’t really multiple ways of access, one is the host and one is ‘inside’ the container

The SSH Server option you pointed to is installed and configured differently than the one I pointed to (SSH Server is in the “Official add-ons” area, I’m pointing to SSH - Secure Shell which is in the “Community Hass.io Add-ons”), and both of these are different than the SSH shell of the host OS, and both of these add-ons get you inside the Hass.io docker container as you said.

Looking back I’m guessing @Ted_Gore is using SSH Server from the Official Add-ons which does not allow configuring a username, so my post may not be relevant. Still need clarity on which he “installed”.

Thanks for all the replies. This is the server I am using…

I tried setting up keys but when I try to paste in the key into the SSH window in hass.io it’s all red and won’t let me save.

Pretty frustrating how difficult this is. All I need is to get the usb hub so I can install z-wave. I really don’t have any other need for SSH access.

Ok I tried changing over to the SSH - Secure Shell add-on. I tried following the instructions as best as possible for generating the key, but when I do the login command in terminal I get the error,

‘Unable to negotiate a key exchange method’

this is what my config looks like:

Why do you need SSH to get zwave?

All looks good. Only difference with mine is I didn’t put a password since its using an rsa key.

I was going to ask what it was you were trying to accomplish… what is it you need from the usb hub (and to clarify, by hub you mean you plugged a hub in to your Pi, or just one of the ports on the back of your Pi)?

My zwave config in configuration.yaml is:

zwave:
  usb_path: /dev/ttyACM0
  polling_interval: 30000

because I need the usb path for the component install. Is there another way?

Yeah I just need the usb path for whatever usb port the zwave antenna is using on the rasberry pi. The directions I’m following instruct to find the path via ssh. Is there anonther way?

I mean…have you tried it that way?

did you put your ssh key in quotes?

{
  "authorized_keys": [
"ssh-rsa ksAAB3NzaC1yc2EAAAADAQA2AAABAQCt3xyhtjh3fzpF5NXizDrsw9HsstsKPl+Zrn0LWXfhORczQuBXPcxEe5dW4Bz7AMnHReCbifg6tyKuKJfWgR6TF5MlE8TYViJKsHpgDfnEkM+e1C7zR3ToydZ4NZT3c1Nlkcya3EOuM7G8n0JltSo1hVd3hTgsyCwEXkX22/Ad0D/LZGXq3QdIwujOosM0ugknSXZTfOsuO68mY9Y2nS12T0N/7NZKaopuMBgic4wUPQ2HPQBjg3klkYhj8e6K1X2YxEoLzmKloHV7DYa34Xmxx8Q8sGzjWxc2hE8phLt/jyGNzeyOvEyb3X/EoDcfZzko7hgMrlGw6O0K7s+6Z64V [email protected]"

],
“password”: “”
}

Keys are not required for either add-on. You can use a password, but keys are more secure. One add-on only allows root as user, the other from the community repo allows for users other than root. When you ssh in, forget the host name and use the IP address instead. For the community repo ssh add-on there’s a web terminal which is convenient. They exist mainly to provide you with the custom CLI commands that hassio has, and are not meant for full system access because there isn’t really a full Linux os to access.

And you don’t need any of this to set up your zwave. But you should have one of them anyway.

Not the best add-on day for me. I’ve installed SSH & Web Terminal. Got the SSH half working with putty, web UI gives me this:

hassnuc:7681. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

ssl is false.

hassbian is so much easier. hassio is incomprehensible.

2 Likes

This!
I’m noob and this was frustrating the heck out of me.
I kept getting the following error using “hassio.local” in puTTY.

“No supported authentication methods available (server sent: publickey)”

I just assumed since I was getting a response it was a key issue, and must have reset my keys and reset my settings a dozen times.

After a frustratingly long time I pulled up the puTTY event log.
image

A quick whois search of the IP address in the logs showed puTTY was connecting to some random address in Denver. I switched puTTY to the local IP address and it connected right up.

Check this post:

How can I go back to the old version SSH addon? Whit the old version I have no problems to connect trough SSH with putty or linux terminal. With this new version I can only use the webterminal, it’s not an improvement.

Did you read the README on hassio-addons/ssh at master ?

Network

To enable ssh access via the network, you need to enter the port number ‘22’ or the port you want to use. This will map that port from the hassio host into the running “Terminal & SSH” container.

In the Network section you need to specify which port your host (the machine running hassio) should map to the 22 internally in the container.

If not specified, no port is accessible from outside.

1 Like

Hello everyone, I had spent two days to solve problems to connect by ssh. I have Home Assistant 0.112.4 and installed ‘Terminal & ssh’ addon through add-ob-store.
I had filled config with my data as describe in docs - fill th username, password, generate and put rsa- key.
What were undeclared in docs:

  1. At configuration page in ‘Network settings’ need to set port 22 at field ‘Host’
  2. Don’t use YOUR username at least for first time when you will try to login. I guess that this user are not exists in your system - you have to create user with that name first. So, first time you can login by ssh with ‘root’ and your pass from configuration.
  3. Don’t spend your time for filling and using rsa-key. You can leave key empty - ‘authorized_keys: []’. In this case addon will automaticaly generate rsa-key, so when you will login first time - you will see a prompt to accept new rsa-keys from your server - just accept it.
  4. When you login as root onto your server then you can create your user (using useradd) and then use your username.
1 Like