December 2018
Beginner
826 pages
22h 54m
English
Run the following from centos1:
[vagrant@centos1 ~]$ ssh -f -L 9999:127.0.0.1:8888 192.168.33.11 sleep 120
You may be prompted for your password (depending on what you've done in terms of key setup) and then be dropped back to the centos1 prompt.
Our SSH connection will stay up for two minutes.
Now, we run a curl, checking that our forwarding is working:
[vagrant@centos1 ~]$ curl 127.0.0.1:9999<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><title>Directory listing for /</title><body><h2>Directory listing for /</h2><hr><ul><li><a href=".bash_history">.bash_history</a><li><a href=".bash_logout">.bash_logout</a><li><a href=".bash_profile">.bash_profile</a><li><a href=".bashrc">.bashrc</a><li><a href=".ssh/">.ssh/</a> ...