I’m running Hassio 0.62.0 on a RPi3 and I was setting up device_tracker to an ASUS RT-AC68U running the latest 3.0.0.4.384 firmware. Since it hasn’t worked at all I’ve been going all over other forum posts and other suggestions trying a variety of items that have fixed this for other people. This is the error I get over and over without any other errors related to SHH in the logs.
My configuration.yaml I’m at now after trying various suggestions to increasing the interval and different locations for the private key. I made the private key in puttygen and saved it with no password and put the public key portion it generated into my ASUS router. I set a wrong path on one try to make sure it was reading it correctly and caused an error about the key not existing then but when it’s correct no errors.
If I load the private key in Putty I can connect to the ASUS without issue. If I SSH to the Hassio install I can SSH to the ASUS as well using the private key. However in both of those cases I had to validate the connection into either the Windows registry or in the case of SSH in Hassio the ~/.ssh/known_hosts file (which is actually gone now after rebooting). Also in both of those cases once I succesfully updated their allowances then I finally saw entries in the ASUS logs for connections.
Log entry from a succesful Putty connection
dropbear[16307]: Pubkey auth succeeded for ‘MyAdminName’ with key sha1!! Public:Derp:Key from 192.168.1.2:61615
Log entry of testing to SSH from Hassio without a user name defined
dropbear[31590]: Login attempt for nonexistent user from 192.168.1.2:57552
I’m wondering if the known_hosts for the container running HA doesn’t exist and it’s blocking it from ever actually making the calls to the ASUS router because I don’t get any log entries there at all that the HA is trying to connect.
I went looking in the asuswrt.py file and found the line that kicks out this specific error.
try:
if not self.connected:
self.connect()
self._ssh.sendline(command)
self._ssh.prompt()
lines = self._ssh.before.split(b'\n')[1:-1]
return [line.decode('utf-8') for line in lines]
except exceptions.EOF as err:
_LOGGER.error("Connection refused. SSH enabled?")
The problem is the block is a bit large in the try code so it’s catching both the connection portion and then the attempt to send a command to it. I might try building a small Python app that connects to my Asus to see what’s happening with this code.
What model & firmware are you on? I had seen other people mentioning having issues after moving to the newer 382 branch and I’m on the even newer 384 firmware branch from Asus.
I upgraded to 0.62.1 and I’m still having the same issue.
I’ll try the username/password option to see if it works since I’m using the PKI based method instead.
Using the username:password method I get a pile of failure errors at first but then it did start working. I believe I saw others report the same behavior on HA startup. I see active connections in my Asus log now from it which I never saw before.
[homeassistant.components.device_tracker.asuswrt] Unexpected SSH error: could not set shell prompt (received: b"unset PROMPT_COMMAND\r\nPS1='[PEXPECT]\$ ‘\r\nset prompt=’[PEXPECT]\$ '\r\n", expected: '\[PEXPECT\][\$\#] ').
So there’s either something broken with the SSH via PKI process or I’ve done something wrong. I did test my public/private key using Putty and they successfully worked there as well as from the core hassio SSH too.