How do I create an ssh tunnel from my laptop to my workstation?
If you are on your laptop and don't want to ssh to ssh.math.ias.edu and then ssh to your workstation, you can set a tunnel through ssh to your workstation.
1) In a terminal window, type:
ssh -X -L 5022:172.16..XX.YY:22 username@ssh.math.ias.edu
Where XX.YY is the IP of your workstation. To find the ip of your workstation, in a terminal window, type ifconfig eth0. The IP is next to inet.
This creates an ssh tunnel on your local port 5022 through ssh.math.ias.edu to your workstation.
Leave this window running.
2) In another window, type:
ssh -X -p 5022 localhost
You will then be connected to your workstation through your local machine's port 5022.
3) If you would like to scp files from your laptop to your workstation directly, open up another terminal window
scp -P 5022 /path/to/file username@localhost:
The file will be copied to the root of your home directory.
4) If you would like to scp files from your workstation to your laptop, open up another terminal window
scp -P 5022 username@localhost:/path/to/file .
The file will be copied to your current working directory.
Note: If you run any X (Gui) applications, you will experience network latency.