Community Hass.io Add-on: Terminal

This add-on is provided by the Community Hass.io Add-ons project.

GitHub Release GitLab CI Project Stage Project Maintenance

Supports armhf Architecture Supports aarch64 Architecture Supports amd64 Architecture Supports i386 Architecture

:warning: Deprecation warning


This add-on is in a deprecated state!

This add-on is now deprecated and has been replaced by a different addon:
“SSH & Web Terminal”

This new add-on combines the SSH and Terminal add-ons into one single powerful solution, contains the latest upgrades and updates, and provide much more tools.

Please upgrade asap since this add-on won’t receive any updates or upgrades anymore.

About


This add-on allows you to log in to your Hass.io Home Assistant instance using a web terminal. Giving you to access your Home Assistant configuration file and folder, and also includes a command-line tool to do things like restart, update, and check your instance.

Installation


The installation of this add-on is pretty straightforward and not different in comparison to installing any other Hass.io add-on.

  1. Add our Hass.io add-ons repository to your Hass.io instance.
    Add the following URL: https://github.com/hassio-addons/repository
  2. Install the “Terminal” add-on.
  3. Start the “Terminal” add-on.
  4. Check the logs of the “Terminal” add-on to see if everything went well.
  5. Surf to your Hass.io instance and use port 7681
    (e.g. http://hassio.local:7681).

Please read the documentation :books: for more information about the use and configuration of this add-on.

Support


You can always get support here at the Home Assistant community forums, join the conversation!

You have several options to get them answered:

You could also open an issue on GitHub, in case you ran into a bug, or maybe you have an idea on improving the addon:

We will do our best to help you out!

Repository on GitHub


Looking for more add-ons?


The primary goal of our add-ons project is to provide you (as an Hassio / Home Assistant user) with additional, high quality, add-ons that allow you to take your automated home to the next level.

Check out some of our other add-ons in our Community Hass.io Add-ons project.

4 Likes

About the author of this add-on

Hi there!

I am Franck Nijhof, and I have 30 years of programming experience, in many languages. I am using this experience to work on the Home Assistant project by giving back my knowledge and time to the open source community.

The add-on you are currently looking at right now was developed/packaged by me. It is not the only add-on I have created; there are many many more :wink:

However, I have a problem… I am an addict. A :coffee: addict that is. Lucky for you, I turn that C8H10N4O2 (caffeine molecule) into code (and add-ons)!

If you want to show your appreciation, consider supporting me for buying a cup of high octane wakey juice via one of the platforms below! :heart:

Sponsor Frenck via GitHub Sponsors

Support Frenck on Patreon

Enjoy your add-on, while I enjoy the brain juice. :coffee:

Thanks for all the :two_hearts:

…/Frenck

Join our Discord server Follow me on Twitter Flollow me on Instragram Follow me on GitHub Follow me on YouTube Follow me on Twitch patreon-icon

P.S.: In case you want to ask me a question: AMA (Ask Me Anything). Most of the time I am online at the Discord chat. (I go by @Frenck in there as well).

Just released another add-on :tada:

Terminal

This add-on allows you to log in to your Hass.io Home Assistant instance using a web terminal. It is like SSH, but in your Home Assistant frontend.

5 Likes

This is nice.
Here is the config for panel iframe:

panel_iframe:
  terminal:
    title: Terminal
    icon: mdi:console-line
    url: http://<hassio host>:7681

Can also use the mdi:console icon.

1 Like

As written in the manual of the add-on itself of course :wink:

That was a polite RTFM :slight_smile:

1 Like

Hehe, I guess you could interpret it in that way, yes :rofl:

Love it - keep it coming…

1 Like

:tada: Add-on: Terminal v2.0.0

Full Changelog

Added

  • Added CodeClimate
  • Added CircleCI
  • Added support for Hass.io’s extended label schema
  • Added persistency of the ~/.ssh folder

Changed

  • Migrated to the new Hass.io build system
  • Migrated to our new base images
  • Rewrite of add-on onto the S6 process supervisor
  • Upgraded the hassio CLI tool to the latest version
  • Updated documentation

This update is now available in your Hass.io panel.

:tada: Add-on: Terminal v2.0.1

Full Changelog

Fixed

  • Terminal does not start, with SSL enabled #13 (cogneato)

Changed

  • Updated ttyd log level to be more useful

This update is now available in your Hass.io panel.

A request: The Open Web UI button in Terminal doesn’t open the https:// page when I have SSL set to true. Can the button be adaptive?

I’m also working to add the panel, but thought I’d ask as an alternative.

1 Like

port forward is needed, right? How? I port forwarded 7681 to IP of HASSIO but is not working (I have duckdns and letsencrypt)

Not sure… your issue description is pretty short on details.

Portforwarding is not needed perse, depends if you’d like to expose it to the outside world I guess.

Please post some more details, like the used add-on configuration, log outputs and stuff.

:tada: Add-on: Terminal v2.0.2

Full Changelog

Changed

  • Updated base images to v1.0.1
  • Protocol adaptive ‘WebUI’ button (Thx @VdkaShaker!)

This update is now available in your Hass.io panel.

1 Like

:vulcan_salute:t3: Now I just have to figure out why :7681 doesn’t get past my router :brain:

HI @frenck

sorry for posting in the incorrect thread before about Terminal quitting after a few seconds. Let me re-post again here, since the issue is still there. Ive tried to follow your directive at using another port, but the interface won’t allow me to do so, and restarting using another port results in a red button.

I’ve port forwarded 7681 in my router wan settings and still no luck.

just checked the supervisor log and the strange thing is it complains about port 22 already being allocated (which is true of course, for ssh) but in the Terminal configuration (both in the add-on itself as in the configuration file section) only 7168 is mentioned…restarting the HomeAssistant instance resulted in a green supervisor log, but the terminal log remains as follows:

Not sure if this has anything to do with it, but i successfully added the IDE add-on, and in the bottom window, the Terminal is never showing up, circling coin in the Tab:


Hope you can have a look again, thanks
Marius

@Mariusthvdb, 2 different add-ons, different issues. Don’t mix up topics, please.

About the issue with the terminal add-on. The error message is clear about the issue like I told you before. The port 7681 is already in use. That is a user error I can’t deal with in my add-on.

You need to share more information in order to get correct help. Things like: The configuration of the add-on, raw logs of the add-on output (please set the log_level to ‘debug’), type of system you are running, versions of the Hass.io Supervisor, OS version, and Home Assistant version information.

sorry, thought since it was both about the terminal not showing up, it might have been an intertwined issue.

I will resend further information of course. Thanks for your specifics.

Any suggestion for another port? as stated, i tried to change that, but the system wouldn’t restart, and gave a red button.

Marius

The add-ons and the Terminals in each of them are not related, but I see the confusion, so don’t worry :slight_smile:

Any port will do, pick something random and high, like 9564? I’m not sure why the button would be red, but yet again, I need more info in order to help you.

im using a Pi3 with the Hassio install version 0.58.1
supervisor: 0.75

33

configuration of the Add-on:

{
  "log_level": "debug",
  "username": "username",
  "password": "password",
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "packages": [],
  "init_commands": []
}

log in debug level (sorry its big):

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 10-hassio: applying... 
[fix-attrs.d] 10-hassio: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Terminal v2.0.2
 Terminal access to your Home Assistant instance via the web
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to DEBUG
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
DEBUG: Requested API resource: http://hassio/supervisor/ping
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {}}
DEBUG: Requested API resource: http://hassio/addons/a0d7b954_terminal/info
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {"name": "Terminal", "description": "Terminal access to your Home Assistant instance via the web", "version": "2.0.2", "auto_update": true, "repository": "a0d7b954", "last_version": "2.0.2", "state": "started", "boot": "auto", "options": {"log_level": "debug", "username": "username", "password": "password", "ssl": true, "certfile": "fullchain.pem", "keyfile": "privkey.pem", "packages": [], "init_commands": []}, "url": "https://github.com/hassio-addons/addon-terminal", "detached": false, "build": false, "network": {"7681/tcp": 7681}, "host_network": false, "privileged": null, "devices": null, "logo": true, "webui": "https://[HOST]:7681", "stdin": false, "hassio_api": true, "homeassistant_api": true, "gpio": false, "audio": false, "audio_input": null, "audio_output": null}}
DEBUG: Filtering response using: .version
DEBUG: Requested API resource: http://hassio/addons/a0d7b954_terminal/info
DEBUG: API HTTP Response code: 200
DEBUG: API Response: {"result": "ok", "data": {"name": "Terminal", "description": "Terminal access to your Home Assistant instance via the web", "version": "2.0.2", "auto_update": true, "repository": "a0d7b954", "last_version": "2.0.2", "state": "started", "boot": "auto", "options": {"log_level": "debug", "username": "username", "password": "password", "ssl": true, "certfile": "fullchain.pem", "keyfile": "privkey.pem", "packages": [], "init_commands": []}, "url": "https://github.com/hassio-addons/addon-terminal", "detached": false, "build": false, "network": {"7681/tcp": 7681}, "host_network": false, "privileged": null, "devices": null, "logo": true, "webui": "https://[HOST]:7681", "stdin": false, "hassio_api": true, "homeassistant_api": true, "gpio": false, "audio": false, "audio_input": null, "audio_output": null}}
DEBUG: Filtering response using: .last_version
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 30-link-common-dirs.sh: executing... 
[cont-init.d] 30-link-common-dirs.sh: exited 0.
[cont-init.d] 40-zsh.sh: executing... 
[cont-init.d] 40-zsh.sh: exited 0.
[cont-init.d] 50-user-ssh-folder.sh: executing... 
[cont-init.d] 50-user-ssh-folder.sh: exited 0.
[cont-init.d] 80-user-packages.sh: executing... 
[cont-init.d] 80-user-packages.sh: exited 0.
[cont-init.d] 81-user-scripts.sh: executing... 
[cont-init.d] 81-user-scripts.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
starting version 3.2.2
[services.d] done.
INFO: Starting the ttyd daemon
[2017/11/27 11:25:54:2594] NOTICE: ttyd 1.3.2 (libwebsockets 2.2.0)
[2017/11/27 11:25:54:2594] NOTICE: tty configuration:
[2017/11/27 11:25:54:2595] NOTICE:   credential: *REMOVED*
[2017/11/27 11:25:54:2595] NOTICE:   start command: tmux new -A -s ttyd zsh
[2017/11/27 11:25:54:2596] NOTICE:   reconnect timeout: 30s
[2017/11/27 11:25:54:2596] NOTICE:   close signal: SIGHUP (1)
[2017/11/27 11:25:54:2598] NOTICE: Initial logging level 7
[2017/11/27 11:25:54:2598] NOTICE: Libwebsockets version: 2.2.0 [email protected]
[2017/11/27 11:25:54:2598] NOTICE: IPV6 not compiled in
[2017/11/27 11:25:54:2599] NOTICE: libev support not compiled in
[2017/11/27 11:25:54:2599] NOTICE: libuv support not compiled in
[2017/11/27 11:25:54:2602] NOTICE:  Threads: 1 each 1048576 fds
[2017/11/27 11:25:54:2864] NOTICE:  mem: platform fd map: 4194304 bytes
[2017/11/27 11:25:54:2866] NOTICE:  Compiled with OpenSSL support
[2017/11/27 11:25:54:2867] NOTICE: Doing SSL library init
[2017/11/27 11:25:54:2940] NOTICE: Creating Vhost 'default' port 7681, 2 protocols, IPv6 off
[2017/11/27 11:25:54:2940] NOTICE:  SSL ciphers: 'takentheseoutforsecurityhere]] NOTICE:  Using SSL mode
[2017/11/27 11:25:54:2948] ERR: lws_context_init_server_ssl: SSL_CTX_load_verify_locations unhappy
[2017/11/27 11:25:54:2998] NOTICE:  SSL ECDH curve 'prime256v1'
[2017/11/27 11:25:54:3013] NOTICE:  Listening on port 7681
[2017/11/27 11:25:54:3013] NOTICE:  mem: per-conn:          448 bytes + protocol rx buf
[2017/11/27 11:25:54:3014] NOTICE:  canonical_hostname = a0d7b954-terminal
[2017/11/27 11:25:54:3014] NOTICE: listening on port 7681
[2017/11/27 11:26:16:7264] ERR: SSL_accept failed socket 7: SSL_ERROR_SSL
[2017/11/27 11:26:16:7264] ERR: *** error:1402609C:SSL routines:ACCEPT_SR_CLNT_HELLO:http request
[2017/11/27 11:26:16:7267] ERR: SSL_accept failed socket 7: SSL_ERROR_SSL
[2017/11/27 11:26:16:7267] ERR: *** error:140260FC:SSL routines:ACCEPT_SR_CLNT_HELLO:unknown protocol
[2017/11/27 11:26:46:7802] ERR: SSL_accept failed socket 7: SSL_ERROR_SSL
[2017/11/27 11:26:46:7802] ERR: *** error:1402609C:SSL routines:ACCEPT_SR_CLNT_HELLO:http request
[2017/11/27 11:26:46:7811] ERR: SSL_accept failed socket 7: SSL_ERROR_SSL
[2017/11/27 11:26:46:7812] ERR: *** error:140260FC:SSL routines:ACCEPT_SR_CLNT_HELLO:unknown protocol
[2017/11/27 11:27:16:9815] ERR: SSL_accept failed socket 7: SSL_ERROR_SSL
[2017/11/27 11:27:16:9817] ERR: *** error:1402609C:SSL routines:ACCEPT_SR_CLNT_HELLO:http request
[2017/11/27 11:27:16:9820] ERR: SSL_accept failed socket 7: SSL_ERROR_SSL
[2017/11/27 11:27:16:9822] ERR: *** error:140260FC:SSL routines:ACCEPT_SR_CLNT_HELLO:unknown protocol

after having changed the port to a random 9748 (container still using 7681/tcp?)

01

the logs show:

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 30-link-common-dirs.sh: executing... 
[cont-init.d] 30-link-common-dirs.sh: exited 0.
[cont-init.d] 40-zsh.sh: executing... 
[cont-init.d] 40-zsh.sh: exited 0.
[cont-init.d] 50-user-ssh-folder.sh: executing... 
[cont-init.d] 50-user-ssh-folder.sh: exited 0.
[cont-init.d] 80-user-packages.sh: executing... 
[cont-init.d] 80-user-packages.sh: exited 0.
[cont-init.d] 81-user-scripts.sh: executing... 
[cont-init.d] 81-user-scripts.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
starting version 3.2.2
[services.d] done.
INFO: Starting the ttyd daemon
[2017/11/27 11:48:18:0063] NOTICE: ttyd 1.3.2 (libwebsockets 2.2.0)
[2017/11/27 11:48:18:0063] NOTICE: tty configuration:
[2017/11/27 11:48:18:0064] NOTICE:   credential: SGFzc0Jvc3M6MG5seU1lIQ==
[2017/11/27 11:48:18:0064] NOTICE:   start command: tmux new -A -s ttyd zsh
[2017/11/27 11:48:18:0066] NOTICE:   reconnect timeout: 30s
[2017/11/27 11:48:18:0066] NOTICE:   close signal: SIGHUP (1)
[2017/11/27 11:48:18:0066] NOTICE: Initial logging level 7
[2017/11/27 11:48:18:0067] NOTICE: Libwebsockets version: 2.2.0 [email protected]
[2017/11/27 11:48:18:0067] NOTICE: IPV6 not compiled in
[2017/11/27 11:48:18:0067] NOTICE: libev support not compiled in
[2017/11/27 11:48:18:0067] NOTICE: libuv support not compiled in
[2017/11/27 11:48:18:0069] NOTICE:  Threads: 1 each 1048576 fds
[2017/11/27 11:48:18:0259] NOTICE:  mem: platform fd map: 4194304 bytes
[2017/11/27 11:48:18:0261] NOTICE:  Compiled with OpenSSL support
[2017/11/27 11:48:18:0262] NOTICE: Doing SSL library init
[2017/11/27 11:48:18:0344] NOTICE: Creating Vhost 'default' port 7681, 2 protocols, IPv6 off
[2017/11/27 11:48:18:0345] NOTICE:  SSL ciphers: 'takentheseoutforsecurityhere]] NOTICE:  Using SSL mode
[2017/11/27 11:48:18:0350] ERR: lws_context_init_server_ssl: SSL_CTX_load_verify_locations unhappy
[2017/11/27 11:48:18:0399] NOTICE:  SSL ECDH curve 'prime256v1'
[2017/11/27 11:48:18:0413] NOTICE:  Listening on port 7681
[2017/11/27 11:48:18:0414] NOTICE:  mem: per-conn:          448 bytes + protocol rx buf
[2017/11/27 11:48:18:0414] NOTICE:  canonical_hostname = a0d7b954-terminal
[2017/11/27 11:48:18:0414] NOTICE: listening on port 7681
[2017/11/27 11:48:33:3086] ERR: SSL_accept failed socket 7: SSL_ERROR_SSL
[2017/11/27 11:48:33:3090] ERR: *** error:1402609C:SSL routines:ACCEPT_SR_CLNT_HELLO:http request
[2017/11/27 11:48:33:3094] ERR: SSL_accept failed socket 7: SSL_ERROR_SSL
[2017/11/27 11:48:33:3096] ERR: *** error:140260FC:SSL routines:ACCEPT_SR_CLNT_HELLO:unknown protocol