#Secure Shell (SSH) could be used to tunnel insecure #Transmission Control Protocol (TCP) connections such as File Transfer Protocol (FTP) or IMAP if the configuration AllowTcpForwarding
is enabled. This provides a secure layer onto the TCP connection without resort to displacing such protocol within a network.
One could run the command below in order to experience this feature:
sudo ssh -N -f -L 142:mail.luna.edu:143 benf@mail.luna.edu
-N
option indicates that SSH should not execute remote command. -f
option requests SSH to go to background just after asking for passphrase. These two options are used in order to establish a tunnel.
-L
specifies the connections to a given TCP port on the local host that is to be forwarded by the remote host.
-X
or -Y
could be used to tunnel the #X Display Manager Control Protocol (XDMCP). The first is usually the more secure option than the latter except in case of Debian. You can change the default behaviour of SSH by modifying SSH Configuration where you can omit the option.