I’m trying to configure the asuswrt component but when I restart HA the log shows the error “Connection refused. SSH enabled?”
I installed HA using the VirtualEnv instructions on Ubuntu 16.04. I’ve verified my router has SSH enabled. If I switch to the homeassistant user (the one created by following the VirtualEnv instructions) I can manually ssh to the router with no problems. I’ve tried setting SSH to listen on multiple ports on the router to make sure there weren’t any conflicts. I’ve tried using ssh key auth and just username / password. Nothing seems to make any difference.
When I manually ssh to the router, the system logs show the successful connection. Also, if I intentionally enter bad credentials the router system log shows the failed attempts. When HA shows the “Connection refused” error in the logs, the router system logs do not show anything. As far as I can tell there wasn’t any attempt by HA to connect to the router.
Anyone out there have any idea what else I can try?
and then restart HA no traffic is captured. As far as I can tell HA isn’t even trying to open an SSH session to the router. I know the tcpdump is working because if I manually open an ssh connection I see the traffic.
How do you start your HASS instance? Do you start it using a systemd script? If so, make sure you have the most recent version:
I also had some troubles. Previously, it was said that you should modify the ENV and PATH variable in the systemd script to ensure the virtual env is loaded. But apparently this is not needed. After I removed those, it worked for me.
I’ve used “Raspberry Pi All-In-One Installer” which create a script using systemd and I think is the most recent version, because HASS start at every boot without a problem.
Run: cat /etc/systemd/system/home-assistant.service
The file might be called a bit different. My output is this:
[Unit]
Description=Home Assistant
After=network.target
[Service]
Type=simple
User=homeassistant
#make sure the virtualenv python binary is used
#Environment=VIRTUAL_ENV="/srv/homeassistant" <-- I commented these and afterwards it worked
#Environment=PATH="$VIRTUAL_ENV/bin:$PATH" <-- I commented these and afterwards it worked
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
[Install]
WantedBy=multi-user.target
Afterwards reload with sudo systemctl daemon-reload
And reboot. That fixed it for me.
I don’t know if your device is set up to be accessible from the Internet, Telnet just isn’t secure. If you don’t care then use it, but it is just asking for trouble.
I’m still experiencing this issue even after throwing away my entire installation and starting fresh. If I try to use telnet instead of SSH I get this message logged in the home-assistant.log file:
Socket exception [Errno -2] Name or service not known