Firstly sorry, maybe dumb question, but I have one service running on my server which can be operated only by telnet (port 23), but I know that telnet is insecure, so I blocked port 23 in iptables except loopback interface (to be not accessible from internet, but only from localhost).
So my idea is that I connect to the server using SSH and then in SSH session I will connect to telnet localhost 23
, so I wonder if it is safe or if it can be sniffed.
telnet
locally on the machine, that you're not really using SSH tunneling. SSH tunneling is where you send the TCP data through the tunnel. See here.telnet localhost 23
, you could set up SSH port forwarding to do it automatically.local> ssh remote
thenremote> telnet localhost 23
isn't really "tunneling", vs.local> ssh -L 2323:localhost:23 remote
thenlocal> telnet localhost 2323
. The first is simpler/less to go wrong, but if you have some other program installed locally that wants to connect via telnet, you could use the latter.