Home Assistant Community Add-on: SSH & Web Terminal

Try to sign in with root as the user name. I have been using root for awhile for port 2222. It does not accept my user name for this port but it does for 22.

as you can see from the addon config I am using root and that is what is set in the PuTTY profile an WinSCP

my config:

allow_agent_forwarding: false
allow_remote_port_forwarding: false
allow_tcp_forwarding: false
authorized_keys:
  - >-
    ssh-rsa
    hidden    rsa-key-20210104
compatibility_mode: false
password: ~hidden
sftp: false
username: hidden

I upgraded from ssh-rsa key to ed25519 key and all working. I bumped the host to use that key as well

Is there any updated info on how to select and copy text from the web terminal? On a Mac…

Using Firefox here and the info I read earlier in the thread of trying modifiers (option or shift-option) don’t seem to work - they prevent highlighting. If I select and release trackpad/mouse button, the highlight disappears without the ability to copy. If I select, then press shift-opt, then the highlight remains, but nothing gets copied with cmd-c or when right-clicking → copy.

I’ve not encountered this issue on another web terminal I use regularly, the one built into Unraid.

ok so fresh from my exuberance at getting this working after updating from ssh-rsa to ssh-ed25519…
On the host I had deleted the old ssh-rsa key and then an ssh command threw in the towell because I had not updated the key in the command. Updated the ket to the new ssh-ed25519 key and it won’t work. Running it from the trerminal also would not work. Says the ssh-ed key is not accepted/not valid. Once I restored the ssh-rsa as an authorised key it works.

So to recap the ssh-web Terminal addon will only work (in PuTTY and Winscp if I use a ssh-ed25519 key
My Debian host will work with either an ssh-ed25519 or an ssh-rsa key
A shell command in home assistant that opens an ssh session to the host will only work with an ssh-rsa key.
As a final kicker I can’t even add the ssh-rsa key in the addon config anymore. It immediately comes up with an error when I save.

Honestly you just couldn’t make this shit up.

I’m probably missing something here, but I can only find the regular SSH “Terminal & SSH” on the Add-on store, and not this one.
Where am I failing?

It’s in the community store

It least they’re making it easy for you.:joy: Image trying to get this working if you don’t know what you are doing?

1 Like

It took a fair bit of dedication and googling to work it all out. The docs for the addon were useless.

1 Like

Franck,

Thanks for making this add-on.

Unfortunately, I have to say that the UI to turn on the SSH server was particularly unintuitive to me. Yes, I read the add-on doc, and it wasn’t of much help. I did get it to work finally, but it took me a long time.

Some suggestions :

  1. Maybe rename the “Network” heading in the configuration to “SSH server” or “SSH daemon”. Or something that makes more sense that just “Network”
  2. Instead of the “Show disabled ports” checkbox, have a checkbox called “Enable server”, with the default being off
  3. Simplify the port selection. This is what it shows currently :

a) Clicking one of the arrows on the right, next to “22/tcp” changes the value of the port on the left side of the control. This is very confusing. I would have expected these arrows to change what’s immediately next to them, ie. what’s on the right . On a 32" wide screen, I initially didn’t even notice that clicking the arrows on the right was changing the value of the field on the left, which was initially blank.

b) why show two port values, one on the left and one on the right ? I’m assuming this is due to some sort of Docker internal. The field on the left is the external port. And the field on the right (hardcoded to 22/tcp) must be the the internal port. If there is any way at all, only the public port should be shown. Does the user of the add-on really care/need to know about the internal port ?
If you only show the external/public port, and move the arrows to the left side, the configuration will make a lot more sense. I think this would be fine for this add-on, which only exposes a single port.

Hi, it’s not clear to me how I set up the ssh auth key when I don’t have access to the HA instance. This information is not written ANYWHERE in the doc. It seems like the doc is missing or assuming some critical information on how to use this tool. I know how to generate private/public ssh keys, but without first accessing to the server, I can’t register my own key.

Its part of the config for the addon

I know that, but I still don’t understand how I can set up ssh without even logging into the server first. The config file assumes you already have root access to the server.

No it doesnt. You dont need root access to install and configure the addon

Could you elaborate more? How am I supposed to enable ssh on the server if I can’t even access the server?

This addon isn’t meant to access the server. It only accesses the container of the addon and Home Assistant container. Are you using HA OS?

Yes, I’m using HA OS. What I meant by the server is the container. What I understand is that the configuration file allows me to specify either the password or the ssh login into the container from the browser. But, I don’t see how I can even setup password or the ssh login if I first don’t have access to it. When I open the terminal, I get bad gateway, too.

Ssh login is setup via the addon configuration. What does the addon log say is happening? You dont need access to the container to set anything up for the addon

I don’t think I see anything in the logs. The first step I did was to try to open the terminal which says “Bad gateway” and I believe that’s because I don’t have access to it which makes sense to me. Is there something I need to do before this? I still feel like I’m missing something crucial.

I also flashed my SD card and tried it again earlier today, but I still can’t connect. 502 Bad Gateway. If you are saying it should connect without modifying any configs, then that doesn’t sound like the case. Maybe you could try it on a fresh HA OS. I’m using HA OS 8.0.

I checked again, but I confirmed there are no logs. Out of the box, I’m pretty sure SSH & Web Terminal gives you Bad Gateway. There must be something I need to do to fix that, but I’m not sure what it is and that’s not written in the doc as far as I know.