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.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

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

분류에서Dev

Doing an SSH reverse port forward without GatewayPorts enabled

분류에서Dev

Connect to ssh from another ssh via script

분류에서Dev

'Unknown response from agent' from Openshift rhc port-forward

분류에서Dev

ssh: connect to host raspberry port 22: No route to host

분류에서Dev

"ssh: connect to host 10.0.2.2 port 22: Connection refused" Only for 10.0.2.2

분류에서Dev

Mysql port forward and access from any pc outside network

분류에서Dev

aws ec2 ssh 오류 :`ssh : connect to host x port 22 : Operation timed out`

분류에서Dev

Connect to LinuxKit with ssh from Windows 10

분류에서Dev

Router won't allow Port forward from 192.168.X.X

분류에서Dev

pfSense port forward for http(s) redirects to private internal ip address when coming from WAN

분류에서Dev

SSH tunnel with different ssh port

분류에서Dev

SSH port not working

분류에서Dev

what is the command to connect a database remotely from other PC

분류에서Dev

How to forward uTorrent port on DD-WRT?

분류에서Dev

Forward requests by IP/Port -> local domain

분류에서Dev

Login with SSH authorized key with changed SSH port

분류에서Dev

Alpine failed to connect to port 587

분류에서Dev

Cakephp router :: connect to forward named params

분류에서Dev

Restrict access to port forwarding in ssh

분류에서Dev

forward all mysql traffic to a ssh tunnel

분류에서Dev

Is it possible to redirect ssh traffic (not forward), How?

분류에서Dev

Why can't I connect to VMWare guest ubuntu via Telnet nor SSH from host?

분류에서Dev

firewall-cmd - add-forward-port don't work

분류에서Dev

Buying a new router because my ISP is blocking port forward

분류에서Dev

Is it possible to have my server transparently forward requests on a specific port to a website?

분류에서Dev

Should a router be able to port forward through double NAT successfully?

분류에서Dev

Automatically forward ports from clients

분류에서Dev

How to place image on part of other image

Related 관련 기사

  1. 1

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

  2. 2

    Doing an SSH reverse port forward without GatewayPorts enabled

  3. 3

    Connect to ssh from another ssh via script

  4. 4

    'Unknown response from agent' from Openshift rhc port-forward

  5. 5

    ssh: connect to host raspberry port 22: No route to host

  6. 6

    "ssh: connect to host 10.0.2.2 port 22: Connection refused" Only for 10.0.2.2

  7. 7

    Mysql port forward and access from any pc outside network

  8. 8

    aws ec2 ssh 오류 :`ssh : connect to host x port 22 : Operation timed out`

  9. 9

    Connect to LinuxKit with ssh from Windows 10

  10. 10

    Router won't allow Port forward from 192.168.X.X

  11. 11

    pfSense port forward for http(s) redirects to private internal ip address when coming from WAN

  12. 12

    SSH tunnel with different ssh port

  13. 13

    SSH port not working

  14. 14

    what is the command to connect a database remotely from other PC

  15. 15

    How to forward uTorrent port on DD-WRT?

  16. 16

    Forward requests by IP/Port -> local domain

  17. 17

    Login with SSH authorized key with changed SSH port

  18. 18

    Alpine failed to connect to port 587

  19. 19

    Cakephp router :: connect to forward named params

  20. 20

    Restrict access to port forwarding in ssh

  21. 21

    forward all mysql traffic to a ssh tunnel

  22. 22

    Is it possible to redirect ssh traffic (not forward), How?

  23. 23

    Why can't I connect to VMWare guest ubuntu via Telnet nor SSH from host?

  24. 24

    firewall-cmd - add-forward-port don't work

  25. 25

    Buying a new router because my ISP is blocking port forward

  26. 26

    Is it possible to have my server transparently forward requests on a specific port to a website?

  27. 27

    Should a router be able to port forward through double NAT successfully?

  28. 28

    Automatically forward ports from clients

  29. 29

    How to place image on part of other image

뜨겁다태그

보관