Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sk3pt1c

macrumors 6502a
Original poster
Nov 29, 2005
918
6
a simulacrum
ok, i've been told to do this with putty which is for windows, but i wanna do it via terminal using bash. how do i set up the tunneling?can someone help out?

1. In Putty, on the 'Session' configuration screen set it to connect using SSH to biscotti.cic.hull.ac.uk or nervosa.cic.hull.ac.uk as normal.
2. Putty SSH tunnel configuration screenshotStill in Putty, select the 'Tunnels' section under 'SSH' and in the bottom section labelled 'Add new forwarded port' enter '4000' for 'Source port' and 'alexandria.cic.hull.ac.uk:5432' as 'Destination'. Press the 'Add' button. The screen should look like this:
3. Press the 'Open' button in Putty to initiate the connection. Log in as normal and leave Putty running - it will catch all traffic on port 4000 and forward it to alexandria (the database server) via the SSH connection to nervosa or biscotti.
 

jeremy.king

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
In Terminal...

Code:
ssh -L 4000:alexandria.cic.hull.ac.uk:5432 biscotti.cic.hull.ac.uk

or 

ssh -L 4000:alexandria.cic.hull.ac.uk:5432 nervosa.cic.hull.ac.uk

Leave terminal running and the tunnel will remain open until you close the SSH session or exit terminal.

Of course, you can optionally pass in a login name (two ways, one with a -l option or username@host) so it would then only prompt for a password. You can even save the session as a term file so you would just double click a shortcut and it would then prompt for your password, so you don't have to always type the commands. Alternatively, you could save it as a shell script...Many ways to kill this tunnelling bird.

Edit: Always remember man is there for a reason.

Code:
man ssh
 

sk3pt1c

macrumors 6502a
Original poster
Nov 29, 2005
918
6
a simulacrum
am not that good at unix, sorry

done it and pgadmin says that the remote host basically said no to the connection

any ideas?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.