setting up the SSH connection
- You need an SSH client. For Windows I recommend the free (libre)
GUI client PuTTY
with lots of features, including the ones we will need. PuTTY will be
used for the rest of this section.
- Run PuTTY. It starts in the "Session" screen; fill in the
settings for your SSH connection. The fields "Host Name" and "Port" are
pretty self-explanatory. You can enter the username too by filling the
"Host Name" field in the "user@host" format. Make sure "SSH" is
selected in "Connection type:".
- Go to the "Connection" -> "SSH" -> "Tunnels" screen to
configure our tunnel.
- Under "Add new forwarded port:", enter some big integer of your
choice to enter for the "Source port" field. (The first thousand or so
ports are sometimes reserved by the operating system; so pick something
bigger.) Here I will use arbitrarily choose 1080 (the SOCKS port).
- Leave the "Destination" field blank.
- Select the "Dynamic" radio button.
- Click the "Add" button. You should see a line in the text box
that reads "D1080" (or whatever number you chose).
- (For those interested, this is the "-D" option in OpenSSH.)
- (Optional:) By default the a login session is opened in the
terminal, which usually runs a "shell", allowing you to run commands on
the command line on the remote computer. If you absolutely do not wish
to use this, you may be able to disable it via the following:
- Go to the "Connection" -> "SSH" screen.
- Check the "Don't start a shell or command at all" box.
- (For those interested, this is the "-N" option in OpenSSH.)
- (Optional:) At this point, it is a good idea to create a saved
session, so
you do not have to go through this process every time. If you wish to
do so, go back to the "Session" screen; enter a name for the session
and click "Save".
- Now you can open the connection. Click the "Open" button at the
bottom.
- The session window will open. If this is your first time
connecting, it will ask you to add the key; "yes" is recommended. Enter
the password when prompted. (You may also set it up to authenticate
using public key instead of password, but that is beyond the scope of
this tutorial.)
- The login session is now connected. As long as the session is
open, you will now have a SOCKS proxy running on on the local computer
(localhost) at port 1080 (or whatever port you chose).
Example: Mozilla Firefox browser
- Go to "Tools" menu -> "Options"
- Go to "Advanced" screen -> "Network" tab
- In the "Connection" section, click the "Settings..." button
- Select the "Manual proxy configuration" radio button
- Make sure "Use this proxy server for all protocols" is unchecked
- Make sure the "HTTP Proxy", "SSL Proxy", "FTP Proxy", "Gopher
Proxy" fields are cleared
- For "SOCKS Host", enter "127.0.0.1", and for "Port" enter 1080
(or whatever port you chose)
- Select the "SOCKS v5" radio button
- Click OK. Click OK.
- Preventing DNS leaks is supported in Firefox 1.5.0.2 and above.
Do
the following:
- Go to the URL "about:config"
- Find the setting "network.proxy.socks_remote_dns" and set it to
"true"
https://www.ocf.berkeley.edu/~xuanluo/sshproxywin.html
lxc
https://hostpresto.com/community/tutorials/install-and-setup-lxc-on-ubuntu-14-04/
create the directory automatically in the container,
https://unix.stackexchange.com/questions/69072/lxc-how-do-i-mount-a-folder-from-the-host-to-the-container
https://askubuntu.com/questions/610513/how-do-i-share-a-directory-between-an-lxc-container-and-the-host
mstsc /admin