ssh tunneling

How to connect to the Sybase database running on sybase.cs.uchicago.edu from Unix

This is how to establish a ssh tunnel to Sybase on sybase.cs.uchicago.edu
A tunnel allows you to connect to our Sybase server from a laptop or other machine that is outside the cs.uchicago.edu domain. It "tunnels" you through our firewall.

  • Open a Terminal (Applications => Utilities => Terminal)
  • Enter the next line, substituting your CS username:
  • ssh -fNL 5001:sybase.cs.uchicago.edu:5000 your-cs-username@classes.cs.uchicago.edu
  • It should ask for your CS password, then simply exit.

Connecting to Sybase on sybase.cs

As long as this Terminal is active (it can be minimized), you should be able to connect to sybase.cs from other programs running on your machine. The only difference is instead of connecting via sybase.cs.uchicago.edu, connect via 127.0.0.1 using port 5001

Debugging

Try telneting to the port on your local machine:
  • telnet 127.0.0.1 5001
If you get Connection refused., the tunnel is probably not in place.
Make sure you have network access, then try the above ssh command again.

If you get Connected to 127.0.0.1...Bad Handshake Connection closed by foreign host. the tunnel is OK. Focus on the software you are trying to make the connection with. Be sure to use 127.0.0.1 instead of sybase.cs.uchicago.edu and use port 5001.