SSH Proxy

Using SSH Proxies for Secure Access to Network Resources.

TL;DR

In this article, we will explore the use of SSH proxies as a secure solution for remote access, especially when a VPN is not available. We will cover what SSH is, the benefits of SSH proxies, how to set up an SSH tunnel on Windows and Linux, using the SSH tunnel with Firefox, and using tools such as Proxifier to simplify routing traffic through proxies.

What is SSH?

SSH (Secure Shell) is a cryptographic protocol for establishing a secure connection over an unsecured network, typically the Internet. SSH provides a mechanism for remote access to systems and network resources in a secure manner by encrypting data transmitted during communication.

What is an SSH Proxy for?

An SSH proxy acts as a secure intermediary between a user and a remote network. Major use cases include remote access to devices on unsecured networks, anonymous Internet browsing through encrypted tunnels, and bypassing geographic restrictions. Using an SSH proxy, an encrypted tunnel can be created to transmit data securely through an insecure network.

socks5

How to Create an SSH Tunnel on Windows Using PuTTY

PuTTY is one of the most popular SSH clients for Windows. Follow these steps to set up an SSH tunnel using PuTTY:

  1. Start PuTTY: Enter the SSH server's IP address and port, then click "Open."
  2. Configure the Tunnel: In the "SSH" section of PuTTY, go to "Tunnels." Specifies a source port for the tunnel and the destination address.
  3. Start Session: Go back to the main screen and click "Open" to start the SSH session.

To configure a SOCKS proxy, go to "Connection" -> "Proxy" and set the proxy type to "SOCKS 5" with the address "localhost" and the tunnel port.

How to Create an SSH Tunnel on Linux from the Shell

Use the following commands from the Linux shell to establish an SSH tunnel:

ssh -D <porta_locale> -f -C -q -N <nome_utente>@<server_ssh>

Where:

  • -D <porta_locale>: specifies the local port for the tunnel.
  • -f: starts SSH in the background.
  • -C: enables compression.
  • -q: disables the printing of debug messages.
  • -N: instructs SSH not to execute remote commands.

To configure a SOCKS5 proxy, make sure that SOCKS configuration is enabled in the SSH client configuration file (~/.ssh/config).

How to Use the SOCKS5 SSH Tunnel with Firefox

To route traffic through the SSH tunnel using Firefox, follow these steps:

  1. Open Firefox: Go to "Settings" -> "General" -> "Network Connection" -> "Settings."
  2. Configure Proxy: Select "Manually configure proxy." Enter "localhost" as the address and the tunnel port as the SOCKS port.
  3. Save and Apply: Click "OK" to apply the settings.

Now Firefox traffic will be routed through the SSH tunnel, ensuring a secure and anonymous connection.

What Is Proxifier Used For?

Proxifier is a tool that simplifies application routing through proxies, including SOCKS proxies. Allows specific applications or all system traffic to be routed through configured proxies.

proxifier

How to Use Proxifier with SSH Tunnel Created

Follow these steps to configure Proxifier with the SSH tunnel:

  1. Start Proxifier: Open Proxifier and go to "Proxies" -> "Add Proxy" to add your SSH tunnel as a SOCKS5 proxy.
  2. Configure Applications: Go to "Rules" -> "Proxification Rules" to specify which applications should use the SSH proxy.
  3. Apply Settings: Save the settings and start the desired applications.

Now, configured applications will use the SSH tunnel as a SOCKS5 proxy, providing secure and anonymous access to network resources.

Using Proxychains on Linux

To use proxychains on Linux and route network traffic through an SSH proxy, follow these steps. First, make sure you have installed proxychains on your system through the package manager of the Linux distribution you are using. Once installed, open a terminal and edit the proxychains configuration file usually located at /etc/proxychains.conf using a text editor such as nano or vi. Within this file, find the section on SOCKS proxies and add the IP address and port of the remote SSH server you wish to use as a proxy. Make sure the format is correct, for example:

socks5 127.0.0.1 9050

Once the proxychains file is configured, you can run any command preceded by the command proxychains, which will route network traffic through the specified SSH proxy. For example, to run the command wget through the SSH proxy, type:

proxychains wget <URL>

In this way, proxychains will start the SSH tunnel specified in the configuration file and route the wget command traffic through it, allowing secure and anonymous access to network resources. Remember that you must have access to the remote SSH server and have valid login credentials to use this technique.

Conclusions

In conclusion, using SSH proxies offers a secure way to access network resources, especially in the absence of a VPN. These allow encrypted tunnels to be created to transmit data securely through unsecured networks. With tools such as PuTTY, Firefox and Proxifier, you can easily configure and manage SSH proxies, providing secure and anonymous access to network resources, even on unsecured networks. Considering the importance of communication security in an increasingly threatening digital environment, the use of SSH proxies is an essential solution to protect sensitive information and ensure online privacy.

autoreGianmarco Bonan  -  03/27/2024  -  Cybersecurity / Networks  -  cybersecurity / linux / protocols / tunneling

Innoviamo insieme nel settore IT

Prenota ora un appuntamento o contattaci per maggiori informazioni sulle nostre soluzioni IT.

logo_footer

Contatti

Via San Defendente 3, 13864 Crevacuore (BI) - Italia

+39 015.8853347
info@tesseractechnologies.com

Lunedì - Venerdì: dalle 9.00 alle 12.00 e dalle 14.00 alle 17.00

Sviluppato con 💪 da Silver srl IT02583190026