I have a remote host C accessible using telnet from host B. From the host A, I use ssh to create a port forward for access to the telnet server of the host C.
I use the following command at hostA
ssh -n -l root <ip HostB> -L3015:<private ip hostC>:23 -N -t -t
With this command I can use telnet localhost 3015 to connect to telnet port of hostC, but depending the hostC model/device the telnet work line-by-line or character.
I want to force telnet to work always in character mode.
I know that I can change the mode using telnet commands, but I need to force this mode without escape to telnet prompt (telnet>). I don't know if there is some kind of environ var to export or some flag/options to pass the telnet client (I don't see nothing at the man page).
Of course if I connect using telnet from Host A or Host B to Host C the telnet mode always is character (not line-by-line)
Best Answer
Not exactly following what you are trying to do...
However, you can specify telnet commands on a host by host basis, or set it for all hosts with the DEFAULT host, with your $HOME/.telnetrc or /etc/telnetrc files. See the 'open host' part of the telnet man page.