Telnet - Supporting authentication

Maybe this shall be a WTF, but place it as a feature request instead. The already existing telnet integration doesn’t support authentication. In my case I wanted to telnet into the router and do a reboot but I guess there are many other scenarios as well. Yes ssh is better but it’s not supported by my old (very old) router. I have been trying to implement a telnet script for this using python code but I never got it to work and gave up

It is uncommon for telenet implementations to implement authentications through the protocol and both client and server should support the same implementation.
The normal way with telenet is to make the connection nd then let the next layer handle the login procedure.

1 Like

Yes, Telnet and Authentication is kind of silly but there are many legacy systems (e.g. routers) that uses telnet.

But either I misunderstood how to use the current Telnet implementation or it doesn’t support handling a login procedure on application level.

I come across this but I couldn’t get it to work. I guess it’s something equal to this that is needed, but without having to use python: Telnet switch with login (command_line switch ) - Share your Projects! - Home Assistant Community (home-assistant.io)

True. The telnet integration does not support authentication. You could use the command line switch/python trick, but leaving a username and password in a python script just does not sit well with me.

If you’re looking for a simple restart, a smart switch (non-WiFi) does the trick as well. Or maybe time to upgrade that router :wink:

1 Like
1 Like

If you actually search the forum you’ll find a python script that does this.

Edit: look, search found it

Yes Telnet is not secure but in my case I can live with the risk since the Internet connection is NAT:ed by the ISP and the only equipment in the LAN network is a RPI based HA and 3 esphome based devices and one iphone at my fathers house (89 years old and starting to be senile) on the country side with no nearby neighbors.

And the router manufacturer (in this case ASUS) did have enough sense to not allow telnet connection from the WAN port

Thanks, yes I found some other very similar posts and I will try it once again. I will also consider a plug to do a power on reset and this plug could be WiFi based as well since the reason for doing a reset on the router is that a ESPHome based Tuya based light bulb is losing connection every now and then and resetting the router makes it connect again

I just would like to point out that the reason for putting this as a feature request is that it’s kind of cumbersome to go through a python script HACS integration to do some simple Telnet commands as we then like as well could use python instead of many other integrations.

For me it would have been a lot easier if there was an existing Telnet integration that supported application based authentication but I’m also aware of that it would be an community based effort and that someone already being comfortable to do this in python would need to put down some work to make it easier for someone else. I will give the Python track a second try but I still think an more advanced Telnet integration would be a good thing

I understand, but I doubt whether you are going to to see an improvement to an integration which is inherently insecure and should probably be taken out of the codebase.

1 Like