I have a server that accept telnet connections for management. I miss the command history so I want to make my telnet session support it. My questions:
1) Do I have to implement that on the server side, so the server will send the past commands to the client and then the client can re-execute?
2) Is there anyway to implement this functionality in the telnet client (not messing with the server) ?
If answer is 1) then I need to know how to capture and send the up and down arrow keys on my telnet session without having to press enter.
The user connects to the server by using the Telnet protocol, which means entering Telnet into a command prompt by following this syntax: telnet hostname port. The user then executes commands on the server by using specific Telnet commands into the Telnet prompt.
Telnet is a type of client-server protocol that can be used to open a command line on a remote computer, typically a server. Users can utilize this tool to ping a port and find out whether it is open.
This isn't a server issue. Just use rlwrap with your telnet client. It gives you readline
with no programming.
$ rlwrap telnet server port
(I actually use nc
instead of telnet
since it is easier to use and is more robust.)
use socat:
socat readline,history=$HOME/.telnet_history TCP:host:23
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With