I have this structure:
client ---> server(debian) ----> target
target is a telnet server.
I'm able to SSH from client to server and then execute telnet to reach target.
How can I configure server (not client), to, as soon the SSH connection is made, open telnet and leave as soon it closes?
From client I know I can use
ssh user@server_ip "telnet target_ip", but I don't have control over client and I don't want eventual clients having any other access to server besides telneting target.
Is this possible?