PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Socks Proxy On Linux

Go down

Socks Proxy On Linux Empty Socks Proxy On Linux

Post by jamied_uk 7th February 2022, 01:46

Set up the SSH tunnel

We’ll create an SSH tunnel that will securely forward traffic from your local machine on port
Code:
9090
to the SSH server on port
Code:
22
. You can use any port number greater than
Code:
1024
, only root can open ports on privileged ports.

Linux and macOS

If you run Linux, macOS or any other Unix-based operating system on your local machine, you can easily start an SSH tunnel with the following
Code:
ssh
command:
Code:
ssh -N -D 9090 [USER]@[SERVER_IP]
The options used are as follows:
  • Code:
    -N
    - Tells SSH not to execute a remote command.
  • Code:
    -D 9090
    - Opens a SOCKS tunnel on the specified port number.
  • Code:
    [USER]@[SERVER_IP]
    - Your remote SSH user and server IP address.
  • To run the command in the background use the
    Code:
    -f
    option.
  • If your SSH server is listening on a port other than 22 (the default) use the
    Code:
    -p [PORT_NUMBER]
    option.

Once you run the command, you’ll be prompted to enter your user password. After entering it, you will be logged in to your server and the SSH tunnel will be established.
You can set up an SSH key-based authentication and connect to your server without entering a password.

Windows

Windows users can create an SSH tunnel using the PuTTY SSH client. You can download PuTTY here .
  1. Launch Putty and enter your server IP Address in the
    Code:
    Host name (or IP address)
    field.

    Socks Proxy On Linux Launch-putty_hu614689e8ae145da4aa50e2795b8a856c_99475_768x0_resize_q75_lanczos

  2. Under the
    Code:
    Connection
    menu, expand
    Code:
    SSH
    and select
    Code:
    Tunnels
    . Enter the port
    Code:
    9090
    in the
    Code:
    Source Port
    field, and check the
    Code:
    Dynamic
    radio button.

    Socks Proxy On Linux Configure-tunnel-putty_huce0255fc0b8e6a1078526a4b29a2838d_85286_768x0_resize_q75_lanczos

  3. Click on the
    Code:
    Add
    button as shown in the image below.

    Socks Proxy On Linux Add-tunnel-putty_hue542b8b73cbd928e934f25bb719036d9_85408_768x0_resize_q75_lanczos

  4. Go back to the
    Code:
    Session
    page to save the settings so that you do not need to enter them each time. Enter the session name in the
    Code:
    Saved Session
    field and click on the
    Code:
    Save
    button.

    Socks Proxy On Linux Save-session-putty_huc6281553c1176b939016c3ba10238d4c_105887_768x0_resize_q75_lanczos

  5. Select the saved session and log in to the remote server by clicking on the
    Code:
    Open
    button.

    Socks Proxy On Linux Open-session-putty_huf445a658c52eedf24d0df75a64042661_105892_768x0_resize_q75_lanczos

    A new window asking for your username and password will show up. Once you enter your username and password you will be logged in to your server and the SSH tunnel will be started.
    Setting up public key authentication will allow you to connect to your server without entering a password.

Configuring Your Browser to Use Proxy

Now that you have open the SSH SOCKS tunnel, the last step is to configure your preferred browser to use it.

Firefox

The steps below are the same for Windows, macOS, and Linux.
  1. In the upper right-hand corner, click on the hamburger icon
    Code:
    to open Firefox’s menu:
  2. Click on the
    Code:
    ⚙ Preferences
    link.
  3. Scroll down to the
    Code:
    Network Settings
    section and click on the
    Code:
    Settings...
    button.
  4. A new window will open.
    • Select the
      Code:
      Manual proxy configuration
      radio button.
    • Enter
      Code:
      127.0.0.1
      in the
      Code:
      SOCKS Host
      field and
      Code:
      9090
      in the
      Code:
      Port
      field.
    • Check the
      Code:
      Proxy DNS when using SOCKS v5
      checkbox.
    • Click on the
      Code:
      OK
      button to save the settings.


Socks Proxy On Linux Firefox-ssh-proxy_hu1c91ea487a779c937bf154f1c018cb59_79435_768x0_resize_q75_lanczos


At this point, your Firefox is configured and you can browse the Internet through the SSH tunnel. To verify, you can open
Code:
google.com
, type “what is my ip” and you should see your server IP address.
To revert back to the default settings go to
Code:
Network Settings
, select the
Code:
Use system proxy settings
radio button and save the settings.
There are also several plugins that can help you to configure Firefox’s proxy settings such as FoxyProxy .

Google Chrome

Google Chrome uses the default system proxy settings. Instead of changing your operating system proxy settings you can either use an addon such as SwitchyOmega or start Chrome web browser from the command line.
To launch Chrome using a new profile and your SSH tunnel use the following command:
Linux :
Code:
/usr/bin/google-chrome \
    --user-data-dir="$HOME/proxy-profile" \
    --proxy-server="socks5://localhost:9090"
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Socks Proxy On Linux Empty Re: Socks Proxy On Linux

Post by jamied_uk 7th February 2022, 06:29

In Kali Linux machine let’s run the command to connect with the Ubuntu using Dynamic SSH tunnelling.
Code:
ssh -D 7000 raj@192.168.1.108


Code:
ssh -L 7000:192.168.22.129:80 raj@192.168.1.108


Last edited by jamied_uk on 7th February 2022, 07:14; edited 1 time in total
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Socks Proxy On Linux Empty Re: Socks Proxy On Linux

Post by jamied_uk 7th February 2022, 06:30

jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Socks Proxy On Linux Empty Re: Socks Proxy On Linux

Post by jamied_uk 7th February 2022, 07:05

keep Sessions Alive

jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Socks Proxy On Linux Empty Re: Socks Proxy On Linux

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum