🆕[add-on] HassOS SSH port 22222 Configurator

HassOS SSH port 22222 Configurator

image
Put your SSH Key in the addon configuration, then start. The addon will enable Port 22222 ssh.

About

This project is a part of my HassOS Configurator project. The goal of this add-on, similar to root apps on Android, is to make a mole-hill out of a mountain.

Installation

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.
Within Home Assistant, click Supervisor-> Add-on Store → … button (in top left)-> Repositories. Add this repository.

Click “HassOS SSH port 22222 Configurator”, then install.

Configuration

Copy your public key into the configurator in a single line as such

SSHKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGTlRAfhm9BIV6l6sOubRgeCY0wRhYQVfB3QBWFl2ELpeAnTHwRYY+4pSP1Nu7FuZqAzDyZkssmFkbXHJGqi6EAnAkRLsKhzvDKo5WSXfEQdl2kSN5bgU/e37GfwqG4ChEfY56gwu+tdHtt4eIrzKpmUKqFZWJaGoeI9sHptQR9QNitEsm0krkOcK0VLFLTeau+HOO1A4plcLjBB9Y43SFjth/Ouke+DVGaBO2LYNc8U0S4EiHT6KdRXS4iIwYjXMw6SEsT7eP9IWQObQ4ZgyG0cHO/6ArxJ0fyOcAI29sLzM9466ID0mTaJWHriTRf6Lxhpdd/S30VTG0JMTdo/Fj  root@HLAB-A17"

After saving, Home Assistant may change your input to look like this image

Operation

Hit the start button and observe the logs. You may uninstall the Add-On when complete.

FAQ

Frequently Asked Questions

Can i use a password?
Due to HA security model, no.

It didnt work! I mean, it didnt work?
Make sure you turn off protection mode.

It still didnt work! I mean, It still didnt work?
Did you run the app and then restart the hardware? Pull the plug and restart the physical hardware.

Its still not working! I mean, why isn’t it working?
Try creating a new public/private key pair with ssh-keygen. You can do this on your computer or use a terminal app, then put the contents of the .pub file into the settings on this addon, then run the addon, unplug power and plug it back in.

24 Likes

From a fresh install on a Raspberry Pi 4, I configured my public key as per the instructions and performed a hard reboot. After the reboot, I was immediately able to login, even before the Web UI was available.

1 Like

As shown above, it goes into the HassOS SSH port 22222 Configurator Configuration screen.

Home Assistant may reformat it to look like this

1 Like

@adamoutler I have no expertise to know if this addon is technically good or has security implications, but if it stops the endless questions about accessing the host system it is more than welcome.

3 Likes

Yes. This addon violates the security model of home assistant, docker containers, and add-ons in general. The entire purpose of containerization is to contain an application and the entire purpose of this application is to remove the containment and modify the host system so that you can log in and modify the host system.
I’m positive this is a bad idea for security reasons. But, like you said. It’s intended to let people get on to hacking rather than ask endless questions in the forums.

6 Likes

I made some security changes by removing app armor. No need to Disable Security anymore.
from this:


to this:

What does this mean? I linked putty to the private key. I am able to connect to 22222, put in root as user and then I get this popup.

image

Looks like you put in the wrong public key. It’s easier to use WSL and apt install ssh, then understand what’s up with ssh -v [email protected]. I’m pretty sure you used the wrong key based on this though.

I copied everything here, put in in configuration and ran the add on.

image

Did you start/restart the addon and reboot after?

Yes. I tried a 3rd time to make new key combo again, now getting this error when trying to start add on. image

Yah, I dunno WTH is going on now. I didnt get that 500 server error the first 2 times I did it.

Uninstalled add-on, restarted HA, installed add on, tried again. 500 error

I’ll try again on a fresh machine tomorrow after I finish some tasks. It’s working for me.

@adamoutler, is this only available for arm? From https://github.com/adamoutler/HassOSConfigurator/blob/553195ec4728503ac17b38df6a187f6641119a1c/HassOsEnableSSH/config.json

 "arch": ["armhf", "armv7", "aarch64"],

I unplugged my HA device,as opposed to just restart, and the add-on worked again. But still no dice, connecting.

heres my config

Honestly I am just trying to get access to add an xml config file to the openzave config folder because it hasnt been added to official repo yet. Apparently I need host access so gave this a try, but Im spending too much time on it, lol. Ill just wait for repo to be updated.

You don’t have an sda1, sd1b, or mmcblk0p1 config.txt. What are you using? Is this windows? When you put a terminal app into Disable Protection Mode, what is the result of ls /dev/?

Currently your system is not supported, but I’d like it to be.

If you can show me an instance of HassOS on x86 with an sda1 “boot” partition, I will support it.

@adamoutler are you asking me? I am using home assistant blue (ODroid N2). But as I said, once I killed power to my device and then restored power and started the machine back up, I was able to use the add-on again. I still dont have access on 22222, but ill just wait for repo to be updated.

1 Like

Can you set your terminal addon to Disable Security, then run the following

ls /dev
mkdir /dev/sda1
mount /dev/sda1 /tmp/sda1
ls -alR /dev/sda1

I would like to see the output from the terminal. I can likely support your device with this.

@adamoutler

1 Like