SSH Tunnel

From GM-RKB
Jump to navigation Jump to search

An SSH Tunnel is a communication tunnel that uses an SSH protocol.



References

2011

  • (Melli, 2011) ⇒ Multi-hop SSH Tunneling Examples
    • localhost$ ssh -t -L 5679:localhost:5679 ubuntu@SERVER1 ssh -L 5679:localhost:3306 SERVER2
      localhost$ mysql -P 5679 -uroot -pPASSWORD .

    • localhost$ ssh -t -L 5679:localhost:5679 ubuntu@SERVER1 ssh -L 5679:localhost:22 SERVER2
      localhost$ scp -P 5679 localfile.txt ubuntu@localhost:/tmp

      ** localhost$ ssh -t -L 5679:SERVER2:22 ubuntu@SERVER1
      localhost$ scp -P 5679 localfile.txt ubuntu@localhost:/tmp

      ** localhost$ EMR_Master_DNS=ec2-54-211-23-27.compute-1.amazonaws.com
      localhost$ SSH_Tunnel_Port=8192
      localhost$ EMR_Port=8192
      localhost$ ssh -vvv \
      -o ServerAliveInterval=10 \
      -i ~/.ssh/myemr.pem \
      -N -L ${SSH_Tunnel_Port}:${EMR_Master_DNS}:${EMR_Port} \
      hadoop@${EMR_Master}