Cannot ssh into pihole

Apparently I must ssh into my Raspberry Pi running pi-hole, but every time I try, I get

ssh: connect to host 192.168.1.8 port 22: Connection refused

I’ve tried

touch /boot/ssh

but that does not help. In fact, it may be that openssh-server is not installed.

Not sure what to do. It’s quite awkward to connect a keyboard, mouse and monitor to it. It runs headless quite well, maybe just can’t upgrade it.

Hi there,

Devices running balenaOS can be SSHd into using either the balena Dashboard via the web terminal, or via the balena-cli ssh command, as SSH does not run on port 22.

More information can be found here: https://www.balena.io/docs/learn/manage/ssh-access/

Best regards, Heds

Sorry, I’m stuck in various loops and I’m not an expert. The upgrade instructions say to type “pihole -up” at the command prompt. If I do this inside the web terminal window, I get

root@a063ac9:/usr/src# pihole -up
Function not supported in Docker images

(following the link above) I then tried downloading the CLI for the Mac and installed it. The instructions say to generate an SSH key. I tried that from the balena window under Preferences, selected “Download from GitHub” and ended up in an endless loop where I was told I didn’t have an SSH key, it looked like it was downloading data, and ended up telling me that I don’t have a key. I don’t see a way out of this.

Hi again,

I believe you need to SSH into the container running the Pihole service, and not the root of the device (the HostOS). When you use the web terminal, there should be a dropdown with a list of services as well as the HostOS. You should be able to select ‘Pihole’ and then SSH into it and run the command.

As for the SSH key, you should be asked for your Github username, which will then be used to download the key you’ve previously registered with them. To do this, you’ll need to follow these instructions first: https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account .If you already have a pre-existing SSH key you’ve not registered with Github, you should just be able to paste the public section of the key into the relevant edit field in the balena Dashboard.

Best regards, Heds

Sorry, I’ve misunderstood part of your answer. You were logged into the right container. I supsect the reason for this is because it’s trying to update its version, and to do this on a running container is not recommend, it’s better to create a new version of the application by updating the version installed in the Dockerfile. Looking at the project Dockerfile here the last update was about a month ago. So if you’ve built this recently, you’re actually running the latest supported version of the project.

Hopefully this makes sense. If not please, let us know and we’ll try and help further.

Best regards, Heds

[note: I’m familiar with Linux and ssh (which I use frequently), but when it comes to Docker and containers, plus various web interfaces on top of them, the whole thing becomes rather indirect and I have very little sense of whose space I’m in…]

At this point I’m happy not to upgrade anything. I’m simply responding to a flashing notice at the bottom of my Pi-hole dashboard:

Pi-hole Version v4.2.2 (Update available!) Web Interface Version v4.2 (Update available!) FTL Version v4.2.3 (Update available!)

I managed to install the CLI application on my Mac, but realized that I have no idea what ssh password the machine wants: Github? pi-hole? Something else? Can I set it somewhere?

When you update in a docker container/image fashion, all you need is to rebuild the image and push the balena. You can’t use the app update mechanisms in the container - as reported by pihole up tool as well.