🆕[add-on] HassOS SSH port 22222 Configurator

I’ve never tried it, but I think you could just use a \n delimiter character between each key

This is probably a really stupid question but could someone explain the advantages of being about to login in as root to the alpine linux with this utility? What knobs does this give you that is better than the HA ssh add on?

It is not alpine linux, HAOS is built on buildroot

If you don’t know, you don’t need it. It gives you raw access to the hardware and filesystems. That’s all. It’s possible to get most access inside a container.

Hi, @adamoutler - Trying without much success to get your 22222 working.
HW - Raspberry Pi4 with USB attached 1TB SSD drive
SW - haos_rpi4-64-10.3.img

Took a fresh install (wrote the image to the SSD) booted device
Configured Username / Localisation to get to standard HA Dashboard
Generated a SSH-KEYGEN on my MAC with “ssh-keygen -t rsa”

Added your repository then installed SSH 22222 application
Added configuration for my Public key with my full key (cut and paste) in SSHKey: “” (Also tried without the SSHKey: “” bit
Started the Addin

Logs:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
no vda1 config found
creating authorized keys in sda1 !
no sdb1 config found
no mmcblk0p1 config found
no mmcblk1p1 config found
no nvme0n1p1 config found
This Configurator did it’s job. Perform a hard-power-off now. This configurator only works once and is no longer needed.

Console Screen had 4x [. timer] /dev/sda1: Can’t open blocked
Restarted anyway …

ssh attempt from MAC:

tricky@TiMac3 Downloads % ssh homeassistant.local -p 22222
The authenticity of host ‘[homeassistant.local]:22222 ([fe80::accf:8769:5a6c:9668%en1]:22222)’ can’t be established.
ED25519 key fingerprint is SHA256:WwhMcts7d69+G1eWIhx8cZElw6riy29ZuXcfRFP+CXI.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:28: [10.1.2.32]:22222
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘[homeassistant.local]:22222’ (ED25519) to the list of known hosts.
[email protected]: Permission denied (publickey).
tricky@TiMac3 Downloads % parted print
zsh: command not found: parted
tricky@TiMac3 Downloads %

I’ve looked at your code in run.sh
when it runs the “mount /dev/sda1 /tmp/sda1”
I’ve done a “mkdir /tmp/sda1”

if I run that manually I get “mount: permission denied (are you root)”
“whoami” reports I am root

I can see /dev/sda through /dev/sda8

For some reason I cannot do a copy from within my window to show you all the files but of your options (

performWork vda1
performWork sda1
performWork sdb1
performWork mmcblk0p1
performWork mmcblk1p1
performWork nvme0n1p1

) I only have the sda files

I’ve installed parted (apk add parted) but when I tried a print I get Error: Error opening /dev/sda1: Operation not permitted

I got it working - but I have to log in as root. Is that the required ID you have to use for this to work?

Thanks for that correction. I never heard of buildroot so I need to do some reading. The reason I thought Alpine was the underlying OS was because of a monitoring HA intergration that I use called “Glances”. The first line of that report shows “(Alpine Linux 3.18.0 64bit / Linux 6.1.34)”…

Core and most addons are built on alpine. The OS is not.

Got it. Thanks for clearing that up.

I’m finding this a tad confusing

ssh 192.168.100.14 -p22222
[email protected]: Permission denied (publickey).

i generated a key pair with ssh-keygen on Ubuntu WSL, and pasted the public as stated.

did a hard reboot

the above is what i keep getting.

You forgot a username

ssh [email protected] -p22222

I’ve reverted to using a SD card to remove the SDA1 (USB Drive) as a test

This time I have no /dev/sda1 as expected ran though same process to try add 22222

Logs show:
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
no vda1 config found
no sda1 config found
no sdb1 config found
no mmcblk0p1 config found
no mmcblk1p1 config found
no nvme0n1p1 config found
This Configurator did it’s job. Perform a hard-power-off now. This configurator only works once and is no longer needed.

Saw no “creating authorized keys in xxxxx” (expected mmcblk0p1 from the script)

when I tried to manually mount:
mkdir /tmp/mmcblk0p1
mount /dev/mmcblk0p1 /tmp/mmcblk0p1 I get Permission denied

whoami show I am root

I am guessing that I am missing a really simple step somewhere in my setup … but first time using HAOS rather than running in docker on my Raspberry (only doing this to try simplify some additional addons)

Did you disable protection mode?

Yes … I ended up reverting to USB sticks to get it working

1 Like

creating authorized keys in sda1 ! → where’s path of authorized keys

1 Like

Depends how you installed home assistant.

1 Like

I found this add on today and installed it on my spare hass 10.5 VM install on Proxmox 8.
It worked first time from PuTTY.
For Proxmox users, its sufficient to shutdown the VM from the Proxmox console and then restart it. There is no need to restart restart the Proxmox host.

The latest version of PuTTY requires the private key path to be entered for every saved connection.
Connection → SSH → Auth ->Credentials: Private key file for authentication.
This is what you will see.
no privkey
When it all works
googlogin

2 Likes

Looks good but only looks for HAOS on sda and sdb, and mine is on sdc :hot_face:

run.sh row 49, partitions=(
vda1
sda1
sdb1
mmcblk0p1
mmcblk1p1
nvme0n1p1
)

There are other options. This won’t be fixed.

Added sdc1 in a fork and got ssh working :+1: