Skip to main content
Menu
SSH Dynamic Port Forwarding on Linux | Cheatsheets
SSH Dynamic Port Forwarding on Linux

SSH Dynamic Port Forwarding on Linux

May 28, 2021
linux
ssh

Step 1 #

Generate SSH keys through ssh-keygen

ssh-keygen 

Step 2 #

Copy your public key form ~/.ssh/id_rsa.pub

$ cat ~/.ssh/id_rsa.pub

Step 3 #

Login into your remote hosted linux machine

Step 4 #

Create authorized_keys file and put your public key into ~/.ssh/ directory

Step 5 #

Create config file with below data and put into your local system where your public and private ssh key exist

Host MyLinux
Hostname <YOUR-REMOTE-HOST-IP-OR-HOST-NAME>
Port <YOUR-REMOTE-HOST-SSH-PORT .EX 22>
User <YOUR-REMOTE-HOST-USERNAME>
DynamicForward 127.0.0.1:8081
IdentitiesOnly yes
IdentityFile ~/.ssh/id_rsa # YOUR PRIVATE KEY 

Step 6 #

Once you created config file and hosted in your ~/.ssh/ directory now you can login into linux system by typing below command

ssh MyLinux

Step 7 #

Install FoxyProxy in either Chrome or Mozilla browser

Step 8 #

Open FoxyProxy and Add New Proxy

  • Manual Proxy Configuration > Host or IP Address > 127.0.0.1 > Port > 8081
  • Select SOCKS proxy
  • Save