"Connection Refused" when trying SSH client to access RPi?

I have installed hass.io on my old RPi 1B+
Seemed to install fine. Wanted to access HA remotely. Started the port forwarding and have created a domain on Duck DNS so don’t have to remember the ip address. Seemed to work. However, using PuTTY (SSH Client) to connect to my RPi but keep getting the message “Network Error : Connection Refused”. I can ping the RPi ok. In my firewall i have also enabled SSH port 22 as an exception. Any help appreciated, as i need to connect so i can cater for having a dynamic ip address.

With HASSIO, you should be using the duckdns add-on, because getting into the host OS will not provide you with anything useful in regards to dynamic DNS, or any Linux tools that you might be used to.

In fact, in hassio, the SSH service on the HOST OS is not listening on port 22.

Hassio is not a general Linux distro. You don’t have access to normal Linux utilities.

I was following this youtube video :
Watch “Port Forwarding, DNS, and Encryption - How To Secure Home Assistant with DuckDNS and Let’s Encrypt” on YouTube

That tutorial was done in 2016, and has nothing to do with HASSIO…

Ok thanks
I followed this video and it mentioned about port forwarding and duckdns
Watch “The Beginner’s Guide to Home Assistant - HassIO” on YouTube

My hassio seemed to install ok.
I wanted to set things up so i could remote access, can you advise on any better guides than the ones i have watched?
Thanks

I don’t know of many resources. It isn’t a complicated configuration really.

Forward port to internal IP. Access remotely.

Watching the video it seemed not so simple :cry:
Any ideas why when i use PuTTY the terminal pops up but then says connection refused?

I already told you. On HASSIO, SSH is not listening on port 22 unless you have the SSH add-on which does nothing for you for duckdns or port forwarding.

I provided a link to an explanation on how to troubleshoot hassio, which involves the SSH service on the host.

Ok i had added the SSH add on.
Will look through the link you provided.
Am confusing myself a bit, thanks for bearing with me

did you create and add your ssh-key?

Please note, that it really doesn’t matter if you can connect to SSH or not. There are very limited functions available in the SSH addon

Thanks, i just did it, i didn’t have a key set. Now i can connect using PuTTY :grin: i am using port 22 and seems all ok. The link you sent me mentions about port 2222
Ok understand that i won’t use SSH much but i just couldn’t understand why i couldn’t connect.

Now onto remote access using duckdns add on :grin:

port 22 goes to the SSH addon. The SSH addon is a docker container running alongside Home Assistant

port 2222 goes to the HOST OS

Ah thanks for the lesson
So as long as i do everything through the add on i use port 22.
However if i want to connect direct to RPi os then its port 2222

1 Like

basically, yes. there are very few reasons to log into the host OS.

Thanks appreciate your help.
Fancy helping with remote access?
Using guide :
Duckdns
I have done the port forward and created a duckdns. From the link do i just need to add the hassio duckdns info {"lets_encrypt…
plus add the http: … into the config.yaml?

I have a dynamic ip address set by service provider bt, does duckdns automatically handle this?

Install add-on.

Configure with your duckdns settings.

Point your config.yaml to the SSL certificates and restart home assistant

Just having problems with the config.yaml.
It doesnt like the ssl line?

http:
base_url: https://my-domain.duckdns.org:8123
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

Can only access HA using Duckdns with http but not for https?

Is this actually where your files are? /ssl? Is that where it maps to?

I copied this info from the home assistance website.
How do i find where these files are?