NMT CSE Wiki

Dept. of Computer Science & Engineering

User Tools

Site Tools


commons:ssh

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
commons:ssh [2020/10/15 14:58]
tylercharity [Dynamic Forwarding] Added a more in-depth tutorial for setting up an ssh proxy in ubuntu 18.04
commons:ssh [2021/01/08 19:27] (current)
hashfastr
Line 46: Line 46:
 ==== Dynamic Forwarding ==== ==== Dynamic Forwarding ====
  
-You can also configure ssh to use any computer you login to as a SOCKS proxy. You can use this to forward your network traffic so that it appears to be coming from the remote machine you're logged into instead of your personal computer. To do that, you can edit or create the file ''~/.ssh/config'' and add something like this:+You can also configure ssh to use any computer you login to as a SOCKS proxy. You can use this to forward your network traffic so that it appears to be coming from the remote machine you're logged into instead of your personal computer. To do that, you can run the following command:
  
-    Host cs +<code> 
-        HostName login.cs.nmt.edu +ssh -D 1337 -q -C -N username@login.cs.nmt.edu 
-        User username +</code>
-        DynamicForward 5050 +
-         +
-The first three lines add a host alias for you so that you can login with ''ssh cs'' instead of ''ssh username@login.cs.nmt.edu'', which is a lot easier to type! The last line creates a tunnel on port 5050 which you can use to redirect traffic through the computer you're signed into (our login server, in this case). What port you use doesn't matter, 5050 is just an example. Now you can configure a proxy on your operating system, or in your web browser ([[https://addons.mozilla.org/en-us/firefox/addon/foxyproxy-standard/|Foxy Proxy]] is a good tool for Firefox, [[https://chrome.google.com/webstore/detail/proxy-switchysharp/dpplabbmogkhghncfbfdeeokoefdjegm|Proxy Switchy]] for Chrome).+
  
-Regardless of the tool you're setting this up with, all you need to know is:+The command will hang (not show any output and not quit), so just minimize the terminal or move it to another workspace. Then you can configure your browser to use the SOCKS proxy by configuring the networking settings as such:
  
-  - The Proxy type is SOCKSv5 +  - Proxy typeSOCKSv5 
-  - The Proxy Host is ''127.0.0.1'' or ''localhost'', which is a loopback address referring to your computer. +  - Proxy Host''127.0.0.1'' or ''localhost'' 
-  - The port is 5050, or any other port number as long as it matches the ''DynamicForward'' option in your ssh config.+  - Proxy port: 1337
  
-For example, on Ubuntu 18.04, you can configure your proxy in settings like so: +If need be you can change the port number by replacing the number following the ''-D'' flag to another number. 
-  - Go to settings->network and click on the gear next to "Network Proxy+ 
-  - Select "Manual" and enter ''127.0.0.1'' in the SOCKS Host field. +For example, on Firefox go to preferences -> network settings and select manual proxy configuration and put HTTP Proxy as localhost port 1337, and the same for the SOCKS host.
-  - Enter your desired port number. +
-  - Clear the "Ignore Hosts" field at the bottom. +
-  - Configure your browser to use your system's proxy settings.+
  
 This won't be incredibly useful for most users, but it's good general information to know about how ssh works and what it can do. This won't be incredibly useful for most users, but it's good general information to know about how ssh works and what it can do.
  
  
commons/ssh.txt · Last modified: 2021/01/08 19:27 by hashfastr