User Tools

Site Tools


nix:proxy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
nix:proxy [2016/08/19 11:12] kauffmannix:proxy [2019/10/16 17:19] kauffman
Line 82: Line 82:
 export http_proxy=http://webproxy.cs.uchicago.edu:3128 export http_proxy=http://webproxy.cs.uchicago.edu:3128
 export https_proxy=https://webproxy.cs.uchicago.edu:3128 export https_proxy=https://webproxy.cs.uchicago.edu:3128
 +</code>
 +
 +
 +===== SSH Port Forwarding =====
 +This has many uses, but one use case we see a lot is to proxy a database connection.
 +
 +You can also do some port forwarding magic with ssh. This is known to work on macOS and Linux based OS's.
 +
 +The following command will open an ssh session to one of the linux machines. Once you've signed in, you can minimize this terminal window. Port 5432 on your local machine has been forwarded through the SSH connection to port 5432 on $dbserver.
 +
 +<code>
 +user@mymachine:~$ ssh -L 5432:$dbserver:5432 <cnetid>@linux.cs.uchicago.edu
 +</code>
 +
 +Now by connecting to localhost:5432 we are actually connecting to the remote server. We can omit '-p 5432' because it is the default. e.g. ''%%user@mymachine:~$ psql -p 5432 -h localhost -U <username> <database-name>%%''
 +
 +<code>
 +user@mymachine:~$ psql -h localhost -U $username $dbname
 </code> </code>
/var/lib/dokuwiki/data/pages/nix/proxy.txt · Last modified: 2021/01/19 09:52 by kauffman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki