🆕[add-on] HassOS SSH port 22222 Configurator

I’m at a loss trying to get this to work. I’m sure I’m missing something.

Steps:
-Opened puttygen and generated a new key.
-Copied key into addon and ran (protection mode off)
-Got success message
-Powered off system. Powered back on
-Opened terminal and entered ssh [email protected] -p22222 (also tried without root@)
-Permission denied (publickey)
-Went into Advanced SSH & Web Terminal addon configuration
-Added key under authorized_keys, restarted addon with protection off
-Still get permission denied (publickey)
-Switched to putty and connected to port 22222
-login as: root
-No supported authentication methods available (server sent publickey)
-Went back to puttygen and saved the key file
-In putty went to Connection - SSH - Auth and selected the saved key file for authentication
-Still get No supported authentication methods available (server sent publickey)

I’ve done this procedure with 3 different keys generated by puttygen as well as the key used in the first post example and keep getting publickey errors.

Where am I messing up?

Not sure puttygen does a compatible key.

I also tried using the one from the example in post #1 just to test if it was a key issue or not.

It does. Might need to play with the encryption setting RSA I don’t think works but pretty sure Ed25519 is good. (I use ed25519 anyway)

Try ssh-keygen -t rsa. Works in windows 10 or linux

1 Like

Thank you SO much for this. You’re a legend!

So I tried putty gen

then login with the key

still asked for login, so i tried root

just puttygen and putty, so definitely possible

got stuck on the login as root, and before that did not disabled addon protection mode, but it tells in the log to disable it

Now how do i access bash or some other regular shell

image

oh nvm, cd /

image

but i was not able to find the addons data directory anyway :confused:

You’re in a regular shell. You can use the ha prompt by typing ha, or you can start/stop/work inside docker containers with the docker command. You got everything.

all good i got confused because i got nothing from ls

I am in but what I see is this when I type ha

How could, for example, execute a command like systemctl I meant I was expecting to see a bash console to execute OS commands, am I missing something here?

HA OS’s entire job is to launch docker. It’s a purpose-built operating system. There’s not much you can do from there. You canapk add nano and then edit any file you’d like with an easy-to-use interface. Most stuff worth editing is in the /etc directory.

No you can’t, it is not Alpine. Having said that I think nano is there already.

That is a console, not sure what shell it is running.

You’re right and I should know this. HassOS.pdf - Google Drive

1 Like

Thanks, just a silly question how could I execute this command " systemctl", when I tried from within a container, I got an error saying command doesnt exist…

You can create a new container, privileged, and mount your /sys,/proc,/dev,/etc and others until you build a replica of the things you need, on an alpine container and then use whatever you need from there. It won’t be easy.

Which container are you in?

If you are logged in to the OS (which this addon enables) then you can run systemctl.

Inside containers, it frankly depends on how the container is built.

In any event, you are getting off topic in this thread,

Just here to say thank you for making this so simple for that very rare odd occassion that I need to jump into the supervisor.

2 Likes

Running Home assistant OS in VirtualBox over Windows11
Trying to gain root access so I can modify some files in the Zigbee2MQTT addon

ex. commands to be run are:

docker exec -it $(docker ps | grep zigbee2mqtt | cut -d" " -f 1) /bin/sh

vi node_modules/zigbee-herdsman-converters/converters/toZigbee.js

docker restart $(docker ps | grep zigbee2mqtt | cut -d" " -f 1)

I installed the HassOS SSH port 22222 Configurator and it worked as expected
then copied public key in SSH addon

but still couldn’t get ssh access with

ssh 192.168.0.xxx -p22222

(something about public key wrong or keyboard input which is obviously not possible with a VM?)

Next I tried “ssh-keygen” and am getting the same results.

Tried starting from scratch but now am getting this and not sure how to delete existing keys…

image

image

Can you provide some guidance on the best way to get this working ?
just can’t find a complete process for my use case.

Thank you.

You don’t need root access to the operating system to do that.

Edit: moved conversation here / opened pull request.

Thank you for your reply, but can you elaborate?
fyi, this is what I am referring to:

I think I managed to login to root and gain access to the container via
the VirtualBox CLI (it does accepts my login and docker commands)

image

Thank you!