What I have done here to test is use an intel nuc running Ubuntu 20.04.2 to install telnetd
username is openhab password is habopen
I can confirm that I can get telnet access from the terminal
However I can't seem to get responses that I can parse when I attempt to use the TCP node.
When I listen on the tcp in node I get this buffer[12] before I ever try to send anything to the telnet server.
Then I get the same as a response if I use the request node.
I have worked out that it is the server making options negotiations
0: 255 IAC
1: 253 DO
2: 24 terminal type
3: 255 IAC
4: 253 DO
5: 32 terminal speed
6: 255 IAC
7: 253 DO
8: 35 X-DISPLAY-LOCATION (XDISPLOC)
9: 255 IAC
10: 253 DO
11: 39 NEW-ENVIRON
I haven't figured out how to get the telnet server to ask for my password the way the terminal will if I pass the option -l username along with telnet
Here's a stripped down flow of where I'm starting from. I also tried this using a raspi as the telnet server will the same results.
[{"id":"88d86f07.b3b768","type":"tab","label":"telnet","disabled":false,"info":""},{"id":"26096609.db0c12","type":"inject","z":"88d86f07.b3b768","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":280,"y":140,"wires":[["5cf26d60.9c4dfc"]]},{"id":"5cf26d60.9c4dfc","type":"function","z":"88d86f07.b3b768","name":"uname","func":"msg.payload = Buffer.from(\"openhab\\r\\n\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":430,"y":140,"wires":[["6ca876fc.a3624"]]},{"id":"531ef101.6d50a8","type":"inject","z":"88d86f07.b3b768","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":280,"y":180,"wires":[["e84bb2e8.a89898"]]},{"id":"e84bb2e8.a89898","type":"function","z":"88d86f07.b3b768","name":"pword","func":"msg.payload = Buffer.from(\"habopen\\r\\n\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":430,"y":180,"wires":[["6ca876fc.a3624"]]},{"id":"405767cc.8453f","type":"inject","z":"88d86f07.b3b768","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"telnet -l openhab","payloadType":"str","x":400,"y":80,"wires":[["6ca876fc.a3624"]]},{"id":"5290eb0f.d598fc","type":"tcp in","z":"88d86f07.b3b768","name":"","server":"client","host":"192.168.3.33","port":"23","datamode":"stream","datatype":"buffer","newline":"","topic":"","base64":false,"x":690,"y":160,"wires":[["623e4301.145cf4"]]},{"id":"623e4301.145cf4","type":"debug","z":"88d86f07.b3b768","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970,"y":160,"wires":[]},{"id":"6ca876fc.a3624","type":"tcp request","z":"88d86f07.b3b768","server":"192.168.3.33","port":"23","out":"sit","splitc":" ","name":"","x":700,"y":80,"wires":[["a1c736d5.0b8dc"]]},{"id":"a1c736d5.0b8dc","type":"debug","z":"88d86f07.b3b768","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":940,"y":80,"wires":[]}]