Home Assistant Community Add-on: SSH & Web Terminal

Hi jippo, I had issues initially setting up the Config Tab too. The example code in the Documentation Tab seems to been from an older version of the AddOn and not formed quite right for v12.0.1. Specifically, my Addon Would not tolerate indents/spacing for the sub-entries like you have under Line 2 ssh:. Additionally, I found the ONLY way the AddOn would accept my RSA key was to follow the TEXT instructions from the Documentation Tab and place the key inside brackets. When you save the config code, it will auto-format to the way it wants it. Example:

authorized_keys: [ssh-rsa blablablablablarsagoodblablablablawbad someuser@somepc]

When you save the config, it will autoformat to:

authorized_keys:
- >-
ssh-rsa
blablablablablarsagoodblablablablawbad
someuser@somepc

tl/dr: Delete all the code indents at the start of lines 3,4,5,8,9,10,11,12. Delete lines 6 & 7 then rewrite line 5 like I showed above using brackets []. Once you get the Public RSA key working, rewrite your Line 4 as:

password: ""

This removes the password as an authentication option (those are two quote symbols with no space). I don’t use the packages: or init_commands: fields but if they are giving you trouble too, try putting those commands in brackets as well like the RSA key and see if the Addon accepts and re-formats your commands the way it wants.

I’m a total noob with this too but that’s how I got that message to clear on my install.

Setting up on a new install I had a similar issue saving as well. In the end I reset the addon to defaults and just edited in the ‘changes’ Then it saved. I had even tried copy/paste from a working install but that wouldn’t work either

Thanks Colin for your reply. You saved my day :slight_smile:
What did the trick for me:
Copied same example from the documentation.
Placed the key like you said: same error.
Then deleted all the mentioned spaces at the start of the lines: Bingo!
Now I can save the configuration, (re)start ssh and connect my PC with HA. It’s finally working.

For the other replyers, also thanks for your contribution.

Hi All

Wonder if anyone here can help me I do not really know SSH and since hassio.addon_stdin was removed from the addon i have been stuck just manually running the below command from the terminal.

I’m using Homeassistant on a Raspberry PI

sudo docker exec addon_a0d7b954_nut upscmd -u xxx -p xxx Cabinet_UPS@localhost beeper.toggle

I use to use the following in an automantion but it does not work any more.

action:
  - service: hassio.addon_stdin
    data:
      addon: a0d7b954_ssh
      input: sh /config/boff.sh

Everywhere i look people say use Shell_command to Call ssh bit i have no idea how to do this. And what the command should look like as I have virtually no experince in SSH is there anyone here who can guide me in getting this working again it is either that or take my pliers open the ups and break off the buzzer from the pc board lol(dont really want to do that) :slight_smile:

Any help will be appriciated

1 Like

I got RSA authentication to work by placing this in the addon config:

init_commands:
  - >-
    echo -en "HostKeyAlgorithms=+ssh-rsa\nPubkeyAcceptedKeyTypes=+ssh-rsa" >>
    /etc/ssh/sshd_config
4 Likes

Hi,

I have this SSH addon:

I need to disable protection mode, since I need to upgrade the firmware of Z-Pi 7, since my current version has a serious bug. Firmware upgrade specify that I need to do this with protection mode disabled.

I do not see any disabling of protection mode on my SSH addon? I’ve seen other comments related to SSH and protection mode, that it might be that I have the official version of SSH and not the community version of SSH, is that the case? If so, where do I find the community SSH version where I can turn off protection mode?

My HA is already running in advanced mode.
Thank you in advance!!
Screenshot 2022-10-09 212923|533x500

I found out I was using the wrong SSH. I was using the official, but it is the community version I needed to be able to connect with protection mode turned off.

To see this SSH (and also the official one) you need to go to your profile in HA web and enable advanced mode.
Then select this SSH:
Screenshot 2022-10-10 195218

Can i ssh to a docker container and backup data ?
i really want to know how i can do that.

i use winscp app

regards

Hi, i did the same but no luck for me. You simply put it in the config? thank you

Hi,
I use this add-on as terminal. I wonder why I can’t see anything inside /mnt/
grafik

That can’t be empty because hassio’s docker mount a lot inside that directory with each container

Any advice?

Thank you! :slight_smile:

I have install and make the configuration.

After this I had access over ssh from my computer.

But now my question. Can I edit the boot/config.txt with SSH & Web Terminal?

If yes how?

No, you can’t. Add-ons are containers and have their own isolated environment.

ok thanks for the Info.

I know it is off toppic. But have you an idea, how is the easiest way I can edit this file?

Because I must change the

enable_uart=1

in this file to get RaspBee II running

After using this Add-on for a few days (fresh install of everything), I next started experimenting with the capabilities to add alpine packages.
I added the following option to the config

packages:
  - imagemagick

did the save which restarted the add-on…
but it does not appear that the package was installed, and nothing in the logs to indicate failure or success.

Any suggestions?

Here is more info:
SSH & Web Terminal
Current version: 13.0.0
protection mode is on

I’m running this add-on happily for quite some time now, but today I run into an issue: I want to add an authorized key, but the configuration won’t persist. I first thought I made a mistake in the configuration, but even dropping one of the existing keys does not persist. After save and restart, the configuration is back to its original.

I’m running the latest versions of everything:

  • Home Assistant: 2023.1.6
  • Supervisor: 2022.12.1
  • Operating System: 9.4
  • Frontend: 20230110.0 - latest
  • SSH & Web terminal: 13.0.2

Anyone an idea?

Sorry about this. I just see that the configuration screen has save buttons per section. I every time scrolled to the end of the page and used the save button at the bottom. Now I noticed the save button in the section. With that, it works as expected.

Implementing a single save button would be helpful for inattentive people like me.

When I try to change the configuration I get an error that one option is missing even it’s present.

This is the config I use, a very basic one:

ssh:
username: hassio
password: ‘’
authorized_keys:
sftp: false
compatibility_mode: false
allow_agent_forwarding: false
allow_remote_port_forwarding: false
allow_tcp_forwarding: false
zsh: true
share_sessions: false
packages:
init_commands:

And this is the error:

Failed to save add-on configuration, Missing option 'allow_tcp_forwarding' in ssh in SSH & Web Terminal (a0d7b954_ssh). Got {'init_commands': [], 'packages': [], 'share_sessions': False, 'ssh': {'ssh': {'username': 'hassio', 'password': '', 'authorized_keys': [], 'sftp': False, 'compatibility_mode': False, 'allow_agent_forwarding': False, 'allow_remote_port_forwarding': False, 'allow_tcp_forwarding': False}, 'zsh': True, 'share_sessions': False, 'packages': [], 'init_commands': []}, 'zsh': True}

I really don’t understand what’s going on.

On the config page, hit the 3-dots and go into YAML mode and see if looks more like:

ssh:
  allow_agent_forwarding: false
  allow_remote_port_forwarding: false
  allow_tcp_forwarding: false
  ....

I’m not sure, but the log has two ssh keys. I think there should only be one

Need some help with this configuration:

allow_agent_forwarding: false
allow_remote_port_forwarding: false
allow_tcp_forwarding: false
authorized_keys:
  - >-
    ssh-rsa
    REDACTION
    rsa-key-20190317
compatibility_mode: false
password: ""
sftp: false
username: tom
log_level: debug
zsh: false
init_commands:
  - >-
    echo 'EXINIT="set showmatch ignorecase" ; export EXINIT ; cd
    /config/appdaemon/apps' >/root/.bashrc

I am trying to use the regular bash shell and create the /root/.bashrc file to set an environment variable, but .bashrc does NOT get created. I’m sure I’m probably missing something very basic here - but any ideas?

Thank you

@rinseaid’s post with init_commands to enable RSA auth for public keys worked for me as well. Thanks!

Used the YAML editing mode for the addon config.

Always satisfying when I get another SSH host working with the PGP/SSH auth key on my Yubikey.