Home Assistant Community Add-on: SSH & Web Terminal

Just installed and found that some commands don’t work. e.g.

➜  ~ hassio host reboot
ERROR
panic: interface conversion: interface is nil, not string

goroutine 1 [running]:
panic(0x2c7050, 0x107ac380)
	/home/travis/.gimme/versions/go1.7.6.linux.amd64/src/runtime/panic.go:500 +0x33c
github.com/home-assistant/hassio-cli/command/helpers.DisplayOutput(0x107b8200, 0x24, 0x200, 0x0)
	/home/travis/gopath/src/github.com/home-assistant/hassio-cli/command/helpers/common.go:118 +0x3c8
github.com/home-assistant/hassio-cli/command/helpers.ExecCommand(0x2f45fc, 0x4, 0x7eb03d86, 0x6, 0x0, 0x0, 0x76500, 0x0, 0x0, 0x0, ...)
	/home/travis/gopath/src/github.com/home-assistant/hassio-cli/command/helpers/common.go:155 +0x308
github.com/home-assistant/hassio-cli/command.CmdHost(0x10778420)
	/home/travis/gopath/src/github.com/home-assistant/hassio-cli/command/host.go:42 +0x4f0
github.com/urfave/cli.HandleAction(0x2af768, 0x324b18, 0x10778420, 0x0, 0x0)
	/home/travis/gopath/src/github.com/urfave/cli/app.go:503 +0xf0
github.com/urfave/cli.Command.Run(0x2f45fc, 0x4, 0x0, 0x0, 0x40bd20, 0x1, 0x1, 0x2fabdf, 0x18, 0x0, ...)
	/home/travis/gopath/src/github.com/urfave/cli/command.go:165 +0x6b8
github.com/urfave/cli.(*App).Run(0x107648c0, 0x1070a1e0, 0x3, 0x4, 0x0, 0x0)
	/home/travis/gopath/src/github.com/urfave/cli/app.go:259 +0x8b0
main.main()
	/home/travis/gopath/src/github.com/home-assistant/hassio-cli/main.go:22 +0x108

and

➜  ~ hassio network info 
Error decoding json invalid character ':' after top-level value: 404: Not Found#  

But the basic one did work

hassio ha restart

Am I doing something wrong?

David/Bobby.

Thank you for your prompt replies to my post. I will give your suggestions a try. It is good to know that the “config” directory corresponds to what Ben referred to as the /.homeassistant directory.

However, I have a bigger issue now that I cannot connect to my RPI using SSH after installing the SSH Shell. After I installed the SSH Shell I noticed I lost standard linux commands, such as those needed to help find and install a Aeotec Z-wave USB stick, such as “ls /dev/ttyACM*” along with other standard linux commands. The Shell seems to limit you to only a few hass.io related commands, but removes the ability to use the standard linux commands or to access my haadmin account. So I uninstalled the SSH Shell and tried to go back to using my old haadmin account that i used when I setup the RPI, but now I am completely locked out and and keep Server refused our key errors with a pop up dialog saying “No supported authentication methods available”. I am hoping I don’t have to start all over and re-image the SD Card in order to get back my standard SSH access, but it looks like that maybe the only alternative as I run this RPI completely headless. If anyone knows how to regain “standard” ssh commands after installing or uninstalling the SSH Shell or SSH Server (I tried both from the hass.io Store) I would appreciate the guidance.

Thanks again for the support of this forum. Without it I would be completely lost I think…

Andrew J

If you are running hass.io you don’t get regular shell access at all so I have no idea what you were doing before but the current behaviour is as you would expect for hass.io. You need to use addons and standard components provided with hassio. Zwave should be supported with no need to inatsll anything.

Hi David. Thanks for your reply. I setup SSH right after I installed Raspbian Stretch Lite in order to finish the installation and to install hass.io. I want to maintain the ability to issue standard Linux commands to update the Pi and perform normal system maintenance and configuration. With the SSH Shell available in the hass.io store it appears you loose most of the standard Linux commands and can only call hass.io commands which is a bit redundant since most of those commands can be called from the Configuration panel.

To fix the issue I ended up having to re-image my SD Card again with Raspbian Stretch Lite and then re-install hass.io. This time I did not install the SSH Shell or SSH Server from the hass.io store. However, as you noted now I cannot access the hass.io commands. So it would appear you have to choose to be either able to use SSH for hass.io or for Linux as there does appear to be away to use SSH for both.

Andrew J

This is no longer about the add-on. Please stay on topic in here or create a new topic for other discussions. Thank you.

:tada: Release v3.0.0

Major release!

This release is a big one! This release merges the SSH & the Terminal add-on into one pretty and useful piece of joy. For example:

You can now pick up your SSH session from the Web Terminal (or the other way around) with ease.

Tons of software has been upgraded, including the Web Terminal. See the changelog for a full list.

:warning: Upgrade notice

You will notice, the configuration has changed a lot.

Some previous set configuration options (like your authorized key) might not be migrated correctly by Hassio. And some new options regarding the Web Terminal are added.

If you do not want to use the Web Terminal, you can simply turn it off.

So check the configuration and make sure you have everything in it.

If it really became a mess on upgrading, I suggest to use the configuration “reset” button and work from that.

Changelog

Full Changelog

Added

  • Rewrites add-on to include both SSH and Web Terminal
  • Adds syntax highlighting in Nano
  • Adds support for audio and UART devices
  • Adds ZSH Autosuggestions
  • Adds ZSH Syntax Highlighting
  • Adds ack
  • Adds access to all possible hardware

Fixed

  • Fixes an issue with SSL not working

Changed

  • Upgrades base image to v2.0.1
  • Upgrades bind-tools to 9.12.1_p2-r0
  • Upgrades git to 2.18.0-r0
  • Upgrades libxml2-utils 2.9.8-r0
  • Upgrades mariadb-client to 10.2.15-r0
  • Upgrades mariadb-client to 10.2.15-r0
  • Upgrades nano to 2.9.8-r0
  • Upgrades ncurses to 6.1-r0
  • Upgrades net-tools to 1.60_git20140218-r2
  • Upgrades nmap to 7.70-r1
  • Upgrades openssh to 7.7_p1-r2
  • Uprades openssl to 1.0.2o-r1
  • Upgrades rsync to 3.1.3-r1
  • Upgrades sqlite to 3.24.0-r0
  • Upgrades sudo to 1.8.23-r2
  • Upgrades tmux to 2.7-r0
  • Upgrades vim to 8.1.0115-r0
  • Upgrades zip to 3.0-r5
  • Upgrades zsh to 5.5.1-r0
  • Upgrades Hadolint to latest version
  • Updates Hass.io ASCII art in MOTD
  • Updates add-on icon & logo
  • Documentation merge and naming updates
  • Layout improvements to README
  • Small tidy up
  • Updates forum URL
2 Likes

:tada: Release v3.0.1

Bugfix release.

Full Changelog

Added

  • Adds instructions on embedding Web Terminal into the frontend

Fixed

  • Fixes add-on devicetree permission issue

I could not access my system in Winscp - I was previously using Sudo-Su in Winscp under ResinOS but now under HassOS and this new addin I can’t had to change from sudo-su to bin/bash and I can connect and list files but I can’t edit anything or delete the database etc… Am I missing something in the settings?

If I use Putty I can delete files. I could use configurator but I just think I have something not configured correctly.

I am using the defaults (with ssh enabled and an authorized_keys migrated in from old snapshot)

I’m sure I just need to change a setting but what?

This add-on does not have sftp enabled by default. Please refer to the documentation on how to enable it.

Secondly, sudo does not make any sense here… since these are docker containers.

I did enable it but it wouldn’t login even when I changed to SFTP in Winscp… Would I still use bin/bash or go back to sudo-su? Also, there used to be an instruction to use root as user before - is that still a requirement…

ok… maybe not sudo su… sp leave it at bin/bash then?

OK I set sftp and username root… it seems to take a long time for everything to start in the addin… maybe I was too impatient before.
I get a warning to not use root… do I need root still for sftp? It mentions root under ssh in the docs… it’s not clear if I need it for sftp.

Not sure what you are talking about here… all the bash/sudo su stuff is not relevant at all.

To enable SFTP do the following:

  • Set sftp to true to enable the SFTP subsystem
  • Ensure the SSH username is set to root (or else the add-on won’t even start and dies with an error message saying it needs to be root)

Connect. To ensure its working, I’ve just tested it using the command line and using Transmit (Mac).

OK so that’s what I actually did and it worked… see my post above yours… It was slow starting - it looked like it was started but wouldn’t connect. I’d say it took 90 seconds or so till it was all started and working.

Happy you got it working.

It still is documented in the same way it used to be. This part hasn’t changed.
https://github.com/hassio-addons/addon-ssh#option-ssh-sftp

In general, it is not advised to use root, as most scans/attacks are targeted against that user. The use of SFTP also lowers the security a bit. So both lower security (don’t worry though).

1 Like

I can no longer backscroll in my terminal window (OS X). I get control characters. How can I re-enable this?

The add-on uses tmux for session sharing. This changes some working. (Google “tmux tips and tricks” or something similar for a crash course :wink: ).

You can regain the old functionality by disabling session_sharing in the add-on options.

Yes, that makes the difference, thanks I was worrying over this one as well.

:tada: Release v3.1.0

This release adds the bluez packages to the add-on: Tools for Bluetooth.
It gives you the possibility to find and debug Bluetooth devices, straight out-of-the-box.

Full Changelog

Added

  • Adds bluez tools for Bluetooth

Changed

  • Upgrades openssl to 1.0.2o-r2
  • Upgrades zip to 3.0-r6

:tada: Release v3.2.0

This release add mouse support!

See my Tweet for a demo: https://twitter.com/Frenck/status/1023876486401536000

Full Changelog

Added

  • Adds mouse support
  • Adds \ as extra keybind for horizontal split in tmux

Fixed

  • Fixes creating extra windows/panes in tmux

With the new version the cert file doesn’t seem to want to load
[2018/07/30 09:20:37:8212] ERR: lws_context_init_server_ssl: SSL_CTX_load_verify_locations unhappy
[2018/07/30 09:20:37:8892] ERR: Unable to load SSL Client certs file from (null) – client ssl isn’t going to work

"ssl": true,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"

If you have read the documentation you would notice it’s known issue:

The following error may occur in your add-on log, and can be safely ignored:

ERR: lws_context_init_server_ssl: SSL_CTX_load_verify_locations unhappy

SSL should normally still work fine.