Forward SSH port - Connect from other place

blablabla

I have a home server behind a NAT. At work I'm also behind a NAT. So to connect from work to my home server I would have to port forward the SSH port in my router at home to the WAN interface.

Would it also be possible to have a permanent ssh tunnel from my home server to a webserver I own. Then when I connect from work I connect to the webserver and let it tunnel to the SSH server on my home server.

And if possible, what would be the security implications?

Servers

  • Home server (behind NAT)
  • Webserver
  • Client (behind NAT)

Connections

  • Home server --> permanent SSH tunnel --> webserver
  • Client --> connects to --> webserver --> gets forwarded to --> Home server
Zalmy

On your home server connect using ssh -R 2222:127.0.0.1:22 [email protected] -N

This will open a ssh session to your webserver.

The -R 2222:127.0.0.1:22 maps port 2222 on the remote server to be redirected to the IP address:port specified in your case 127.0.0.1:22

Use -N if you don't want an interactive session.

On the client connect to your webserver using ssh -p 2222 [email protected] you must specify the port since it's not the default.

You also have open the port in your firewall configuration.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to connect ssh from a specified port?

From Dev

ssh port forward to access my home machine from anywhere

From Dev

Is it bad to port forward port 443 for ssh?

From Dev

How do I ssh tunnel port forward?

From Dev

Configuring iptables to port forward ssh connection to a server

From Dev

How to connect to a certain port on SSH

From Dev

How do I forward a SSH port from any interface to a specific IP?

From Dev

SSH shows the wrong IP address when SSH with port forward

From Dev

Git SSH won't connect on custom port

From Dev

Connect SSH to server on port 2222 via the terminal

From Dev

unable to connect to forwarded port over ssh

From Dev

Git SSH won't connect on custom port

From Dev

ssh: connect to host port 22: Connection refused

From Dev

ssh: connect to host host port | No firewall

From Dev

Is there a way to change default ssh connect port?

From Dev

ssh connect to host port 22: Connection refused

From Dev

forward the domain and remove the port number from the URL

From Dev

How to forward a port from one machine to another?

From Dev

Redirect/forward service from port as page

From Dev

Port forward not working from modem to router to server

From Dev

Port forward from VPS to PPTP client

From Dev

Port forward from LAN to an OpenVPN client (iptables?)

From Dev

How to port forward passive FTP from a router

From Dev

Forward port from 80 to 9000 not working

From Dev

Forward UDP packets from one port to another

From Dev

How to make SSH remote port forward that listens 0.0.0.0

From Dev

SSH Port Forward a local IRC server to my remote server

From Dev

SSH disable port forward remotely instead of killing process on the server

From Dev

Ubuntu 14.04 LAMP/SSH port forward problem/connecting to internet

Related Related

  1. 1

    How to connect ssh from a specified port?

  2. 2

    ssh port forward to access my home machine from anywhere

  3. 3

    Is it bad to port forward port 443 for ssh?

  4. 4

    How do I ssh tunnel port forward?

  5. 5

    Configuring iptables to port forward ssh connection to a server

  6. 6

    How to connect to a certain port on SSH

  7. 7

    How do I forward a SSH port from any interface to a specific IP?

  8. 8

    SSH shows the wrong IP address when SSH with port forward

  9. 9

    Git SSH won't connect on custom port

  10. 10

    Connect SSH to server on port 2222 via the terminal

  11. 11

    unable to connect to forwarded port over ssh

  12. 12

    Git SSH won't connect on custom port

  13. 13

    ssh: connect to host port 22: Connection refused

  14. 14

    ssh: connect to host host port | No firewall

  15. 15

    Is there a way to change default ssh connect port?

  16. 16

    ssh connect to host port 22: Connection refused

  17. 17

    forward the domain and remove the port number from the URL

  18. 18

    How to forward a port from one machine to another?

  19. 19

    Redirect/forward service from port as page

  20. 20

    Port forward not working from modem to router to server

  21. 21

    Port forward from VPS to PPTP client

  22. 22

    Port forward from LAN to an OpenVPN client (iptables?)

  23. 23

    How to port forward passive FTP from a router

  24. 24

    Forward port from 80 to 9000 not working

  25. 25

    Forward UDP packets from one port to another

  26. 26

    How to make SSH remote port forward that listens 0.0.0.0

  27. 27

    SSH Port Forward a local IRC server to my remote server

  28. 28

    SSH disable port forward remotely instead of killing process on the server

  29. 29

    Ubuntu 14.04 LAMP/SSH port forward problem/connecting to internet

HotTag

Archive