Home Assistant Community Add-on: SSH & Web Terminal

Hi David,

Thanks for your prompt feedback. I changed the port to 23 and it did work, however I wonder how was I able to access it on the default port (22) before today?

I am running Home Assistant on an OpenMediaVault installation, and I was able to SSH both to the OMV and to the HomeAssistant using the default port with different usernames. What could have changed that does not allow me to do it now? Could it be the network connectivity of the HomeAssistant - it is “Host” and I believe it was set on “Host” before as well…

 netstat -tan
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:44479           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:35717           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN     
tcp        0      0 192.168.0.137:5357      0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:44877           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:50063           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:55669           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:8123            0.0.0.0:*               LISTEN     
tcp        0      0 172.30.32.1:63099       0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN     
tcp        0      0 192.168.0.137:36294     192.168.0.173:23        TIME_WAIT  
tcp        0      0 192.168.0.137:42512     122.51.123.203:443      TIME_WAIT  
tcp        0      0 172.30.32.1:42902       172.30.33.0:1883        ESTABLISHED
tcp        0      0 192.168.0.137:36320     192.168.0.173:23        TIME_WAIT  
tcp        0      0 192.168.0.137:36000     192.168.0.137:23        ESTABLISHED
tcp        0      0 192.168.0.137:48766     3.122.122.135:8080      ESTABLISHED
tcp        0      0 172.30.32.1:8123        172.30.32.2:57040       ESTABLISHED
tcp        0      0 127.0.0.1:39785         127.0.0.1:50474         ESTABLISHED
tcp        0      0 192.168.0.137:36302     192.168.0.173:23        TIME_WAIT  
tcp        0      0 192.168.0.137:42514     122.51.123.203:443      TIME_WAIT  
tcp        0      0 127.0.0.1:53305         127.0.0.1:1883          ESTABLISHED
tcp        0      0 192.168.0.137:36342     192.168.0.173:23        TIME_WAIT  
tcp        0   1568 192.168.0.137:22        192.168.0.121:49951     ESTABLISHED
tcp        0      0 192.168.0.137:36354     192.168.0.173:23        TIME_WAIT  
tcp        0      0 192.168.0.137:8123      46.238.53.219:50103     ESTABLISHED
tcp        0      0 192.168.0.137:36330     192.168.0.173:23        TIME_WAIT  
tcp        0      0 127.0.0.1:50474         127.0.0.1:39785         ESTABLISHED
tcp        0      0 192.168.0.137:23        192.168.0.137:36000     ESTABLISHED
tcp        0      0 192.168.0.137:42540     122.51.123.203:443      TIME_WAIT  
tcp        0      0 192.168.0.137:42510     122.51.123.203:443      TIME_WAIT  
tcp        0      0 192.168.0.137:42550     122.51.123.203:443      TIME_WAIT  
tcp        0      0 192.168.0.137:55216     52.57.118.192:8080      TIME_WAIT  
tcp        0      0 192.168.0.137:42546     122.51.123.203:443      TIME_WAIT  
tcp6       0      0 :::8000                 :::*                    LISTEN     
tcp6       0      0 :::36673                :::*                    LISTEN     
tcp6       0      0 :::2049                 :::*                    LISTEN     
tcp6       0      0 :::9090                 :::*                    LISTEN     
tcp6       0      0 :::60935                :::*                    LISTEN     
tcp6       0      0 :::9000                 :::*                    LISTEN     
tcp6       0      0 :::5355                 :::*                    LISTEN     
tcp6       0      0 :::139                  :::*                    LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 :::8883                 :::*                    LISTEN     
tcp6       0      0 :::60371                :::*                    LISTEN     
tcp6       0      0 :::8884                 :::*                    LISTEN     
tcp6       0      0 :::21                   :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 :::23                   :::*                    LISTEN     
tcp6       0      0 :::1883                 :::*                    LISTEN     
tcp6       0      0 :::1627                 :::*                    LISTEN     
tcp6       0      0 :::43355                :::*                    LISTEN     
tcp6       0      0 :::1884                 :::*                    LISTEN     
tcp6       0      0 :::51165                :::*                    LISTEN     
tcp6       0      0 :::445                  :::*                    LISTEN     

I wouldn’t use 23 as that is normally reserved for Telnet…

Hello, thanks sir.

I am still wondering how I was able to ssh into OMV and HomeAssistant (using different users) on the same port…

I am running Home Assistant on an OpenMediaVault installation. What could have changed that does not allow me to do it now? Could it be the network connectivity of the HomeAssistant - it is “Host” and I believe it was set on “Host” before as well…

Hello. I prefer to use bash over zsh. How can I set up a bashrc and bash_aliases and have them sourced upon login of non-root user? A created the files but they do not persist. Thanks

I did a fresh install of Home Assistant/Hassio on a RPi with the 3.13 image and this add-on is not available from the add-on store. (or anything related to SSH)

Has this been removed? I usually recommend setting up SSH as soon as possible in case of braking the WebUI by misstake (even if it is getting harder and harder…).

It seems the SSH add-on is now hidden until you enable advanced mode

image

Click on your name in the lower left corner and enable advanced mode. Then you will probably see it.

3 Likes

Hi! The latest update removed port 22. So far ssh so I connected. Now it says that port 22 is in use. Why? Of course you can rewrite the port, but I want to know what has changed. Thank you

I have just tried to install the addon and it wont start stating;
Bind to port 22 on 0.0.0.0 failed: Address in use.
Bind to port 22 on :: failed: Address in use.
Cannot bind any address.
[cont-finish.d] executing container finish scripts…
[cont-finish.d] 99-message.sh: executing…
I do have ssh enabled on the underlying raspbian. Do I need to change that? or am I able to change the add-on port?

You can’t use port 22 for BOTH So set a different port for the addon. I use 622. Then I can ssh 22 for the host (Debian in my case) and 622 for Hassio

David how you set the port on the addon

image

1 Like

hmmm feeling stupid … thanks

Is this addon available for 64bit RPI 4? I dont see it on the addon store

Have you set the setting to advanced mode?

1 Like

Thanks for the pointer!

1 Like

Does anyone know if it’s possible to emulate the CTRL key on a smartphone when using this add-on ? Typically to stop a command with CTRL-C ?

Find a client that supports CTRL? Pretty sure Terminus and also iTerminal for iOS do that.

Perhaps my question lacked clarity. I would like to use the embedded web terminal to avoid the authentication process with another client. I already use Termux for other tasks and it supports the CTRL key.

Hello, after certain time I try to connect over ssh to hassio but when I try to connect fowling ist Printen in the log file off the add-on: Connection closed by authenticating user root … [preauth]
om my client: Permission denied (publickey,keyboard-interactive)

key is set configured has worked before 3 months

any ideas ?

EDIT: I reinstalled the add-on and now it works

I am new to Home Assistant and have played with it for a couple of days and have had this Add-on installed and working.
My HA is local only (behind firewalls etc) so would like to have just a password.
Now I have a fresh RPi running latest HA version

If I add the configuration

authorized_keys: []
password: 'my-password'

and save, it removed the single quotes and looks like

authorized_keys: []
password: my-password

When starting I get:

[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] cli: applying... 
[fix-attrs.d] cli: exited 0.
[fix-attrs.d] profile: applying... 
[fix-attrs.d] profile: exited 0.
[fix-attrs.d] ssh: applying... 
[fix-attrs.d] ssh: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] keygen.sh: executing... 
[16:31:26] INFO: Restoring host keys...
cp: can't stat '/data/host_keys/*': No such file or directory
[cont-init.d] keygen.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

Any idea of what is wrong?