Home Assistant Community Add-on: SSH & Web Terminal

Updated today to fix this

If I understand correctly, in this latest addon version hassio.addon_stdin was removed.

How can we issue SSH commands from within automation? I am pushing URL with catt command for example.

Thank you.

4 Likes

Great, I confirm the new update fixes the font issue in Firefox. :ok_hand:

I believe I am in the same boat.
I am invoking the addon within a Script.

Am looking for workarounds as well…

Bob.

I’m also a bit stuck and looking for advice following the changes. My use case at the moment is I’m running Hassio with the LetsEncrypt add-on which daily checks if I need a new cert and if so creates it in ~/ssl. I have this generating certs with subdomains for a few other servers I have. I then had an automation that would run when the add-on stopped which was secure copying the files to those other endpoints. With addon_stdio gone I’m not sure how to transition the following

service: hassio.addon_stdin
data:
  addon: a0d7b954_ssh
  input: scp ~/ssl/certificate.pem [email protected]:~/ssl/certificate.pem

I was looking at shell_command to then trigger the scp however I’m not sure how or if I can access the ~/ssl path that the letsencrypt add-on places the generated certs (and where other addons expect the certs to be). Been doing some basic tests of shell_command to call “touch ~/ssl/test” among a few variations without luck. I was able to perform a “touch” in the config folder which the documentation states is the default execution location but that’s not where the certs are.

I could just have my other servers (or even just one go them) pull the certs by doing an SCP from them, but I always liked that the automation pushing the certs out immediately after they were generated was instant and centralised. Does anyone have suggestions on how I can get a file from the ssl mount in order to SCP to another host?

update: For now I’ve just moved the scp functions to another server which is working for me and scheduling that to run daily.

After upgrading to V10.0.0, the energy monitor stopped collecting data. Restoring back to v9.1.1 and my Energy graph started working again. The total power sensor has no errors in the history.
Fortunately, I had only updated 1 Add on at the time it started failing so it was easy to determine the issue (it was off for about 2.5 days before I noticed).
I don’t understand why/how this add-on would interfere with Energy Total. Anyone got any ideas on where I would look?

Maybe a stupid question, but how/where do I set/find the ssh username/password that I can use in the config of this add-on?

Regards,
Joost

hello,
did you manage to solve this problem ??

I try to ssh to an old linux server from HA terminal and I get exactly the same error

no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

I used the compatibility_mode: true but it didn’t make any difference.
(I am trying to connect to a local linux server (centos 5.9)

@solomos Yes, problem was solved, but I don’t remember how. that was long time ago. What is your SSH & Web Terminal configurations ?

After a lot of searching I found that I can login to remote Linux server by the following command:

ssh -o KexAlgorithms=diffie-hellman-group1-sha1 [email protected]

This bypass the exchange method problem and it prompts me for a password!!
Bingooo!! :slight_smile:

As I don’t want to enter any passwords, because I want to call ssh from within a shell script I followed this guide (which is fantastic) to generate a pair of authentications keys.

http://linuxproblem.org/art_9.html

I followed the instructions and I am sure that I did it right.
However I came again in front of the host’s old version. (very old actually - it runs centos 5.9)

Using the following SSH command

ssh -o KexAlgorithms=diffie-hellman-group1-sha1 -i /config/ssh_keys/pbxsrv_key_private.ppk [email protected]

…As you can see above, I tried to bypass the exchange method problem and use a key instead of a password at the same time.
I don’t get any configuration errors

Instead I get the following error:

Load key "/config/ssh_keys/pbxsrv_key_private.ppk": invalid format

I used the key and I can login properly from a putty client.

Any help will be much appreciated!

thank you for your reply!
I made some progress. Please see my previous post.

Can you help?

Hello, I’m also looking for a shell_command that would execute mosquitto_pub, as it did very well with:
- service: hassio.addon_stdin
data:
addon: a0d7b954_ssh
input: “mosquitto_pub -h 192.168.1.50 -u myname -P mypass -t cmnd/sonoff9/power -m off”

but, sadly, this does not work any more …

This shell_command never works:

shell_command:
lampe_labo_on: '/usr/bin/mosquitto_pub -h 192.168.1.50 -u myname -P mypass -t cmnd/sonoff9/power -m on

the shell_command never finds /usr/sbin/mosquitto_pub, even though I can execute it manually in the HomeAssistant CLI:
➜ ~ /usr/bin/mosquitto_pub -h 192.168.1.50 -u myname -P mypass -t cmnd/sonoff9/power -m on (that works)

are you aware of a solution to would replace the convenient and easy “service: hassio.addon_stdin” was providing, too bad it is not there anymore…
Thank’s

Hello,
I would like to hear a solution as well. Did you find any?

Thanknyou.

Is there some setting that I am missing to control the resolution?
Is it done at the shell?

image

Hi
This addon worked for me before however, i get a 502: bad gateway when trying to reach webgui
Dont know since when this is.

Add-on: SSH & Web Terminal
SSH & Web Terminal access to your Home Assistant instance

Add-on version: 10.0.2
You are running the latest version of this add-on.
System: Home Assistant OS 7.2 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2021.12.10
Home Assistant Supervisor: 2021.12.2

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] docker.sh: executing…
[cont-init.d] docker.sh: exited 0.
[cont-init.d] mosquitto.sh: executing…
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] mysql.sh: executing…
[cont-init.d] mysql.sh: exited 0.
[cont-init.d] ssh.sh: executing…
[13:49:25] WARNING:
[13:49:25] WARNING: Logging in with a SSH password is security wise, a bad idea!
[13:49:25] WARNING: Please, consider using a public/private key pair.
[13:49:25] WARNING: What is this? Set up SSH public key authentication to connect to a remote system
[13:49:25] WARNING:
[cont-init.d] ssh.sh: exited 0.
[cont-init.d] user.sh: executing…
[13:49:28] NOTICE: Session sharing has been disabled!
Collecting catt
Downloading catt-0.12.7-py3-none-any.whl (26 kB)

FYI: This works for me :slight_smile:
Thanks

I get bad gateway too. Add on also crashes 30 seconds after starting…

Here too, is this a known issue?
Updating to latest HA version doesnt fix it

Anyone has a solution for this? :frowning:

I got it back working

There was this in my old config
init_commands:

  • python3 -m pip install catt

I deleted the addon and did a stock install without the init commands, and now its working again