0

We are trying to connect to Linux telnet service using simple terminal program; I suspect server is set to default VT-100, and telnet server sends control handshake sequences, expecting terminal to reply with its supported options, and hangs waiting for terminal reply.

enter image description here (apologies for poor quality of image)

Unfortunately terminal is just bare communication program and does not know about telnet protocol.

Is there any way to tell to telnet server (e.g. through setting specific terminal type) not to start identification of remote terminal properties, but go directly to the communication?

Edit:

Please edit question with more details: What terminal are you using, what "bare communication" program is it?

Communication program opens TCP connection to the linux PC to port 23, then sends characters typed on the keyboard and displays characters received on the screen without any character processing.

Can you run netcat on the server instead (or in addition) of telnetd, and use this to debug if the communication by itself is working

I am not sure, I do not control both machines. But is it 100% fact that machine running terminal is able to connect to the linux machine, and linux machine is able to send telnet protocol control characters (you can see it on the picture - white chars are 0xff - start marker of telnet option). I can not say 100% because I do not have Wireshark logs, but seems communication works properly, and it is telnet server which does not pass through telnet protocol handshake.

Once you are connected, do you want to login, or do you want to do anything else? Can you use something safer on the terminal, e.g. ssh?

Yes, I want telnet server to display "login: " asking to log into the system. telnet service on the linux machine is operational, because it is possible to log it from third machine using telnet client - but this telnet client is aware about telnet protocol and responds to it. In the case described above temrinal program knows nothing about telnet control codes/protocol, and displays them as characters without any further action (response according to telnet protocol).

  • What do you mean by "simple terminal"? Telnet itself does not start identification of remote terminal properties. This kind of thing could be done by the shell that is being used though. Have a look at /etc/screenrc and see if you can customise that. – davidgo Apr 5 '18 at 21:14
  • Telnet server sends specific control sequence before starting communication, and client must (or should?) respond with answers to the questions telnet server asks. This is actually telnet protocol RFC 854. It seems we need to disable this functionality... – Anonymous Apr 5 '18 at 21:34
  • Please edit question with more details: What terminal are you using, what "bare communication" program is it? Can you run netcat on the server instead (or in addition) of telnetd, and use this to debug if the communication by itself is working? Once you are connected, do you want to login, or do you want to do anything else? Can you use something safer on the terminal, e.g. ssh? – dirkt Apr 6 '18 at 10:54
1

First of all, telnet negotiation has nothing to do with terminal types. (Indeed the terminal type is determined during telnet negotiation.) So you cannot disable the former by changing the latter.

How you can disable it depends on the specific telnetd implementation on the server. (I've counted five different in.telnetds just on Linux, other OSes have their own.)

Sometimes there is a telnetd command line option that you can use in service configuration (that is, in a systemd .service file or /etc/inetd).

If everything fails, you can just compile your own patched telnetd version; all Linux distros have a way to rebuild packages from the official recipe (dpkg-buildpackage, makepkg...)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.