tuxmartin

Untitled

Apr 28th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. INTERNET
  2. NAT
  3. + +
  4. | |
  5. | |
  6. | |
  7. | |
  8. | | +-------------+
  9. +----------------+ | | | |
  10. | VPS | | | | Muj PC |
  11. +---------> verejna IP +----------------------> |
  12. | | | | | |
  13. +----------------+ | | +-------------+
  14. | |
  15. | |
  16. | |
  17. | |
  18. | |
  19. | |
  20. + +
  21.  
  22. Na VPS pridat do /etc/ssh/sshd_config "GatewayPorts yes".
  23.  
  24. Stavajici situace:
  25. Na PC:
  26. # ssh -R *:2222:localhost:22 [email protected]
  27.  
  28. Na VPS:
  29. # iptables -I INPUT -p tcp --dport 2222 -j ACCEPT
  30. # iptables -I FORWARD -p tcp --dport 2222 -j ACCEPT
  31.  
  32. Pote pripojeni na PC:
  33. # ssh localhost -p 2222
  34.  
  35.  
  36. Co chci:
  37.  
  38. Na PC:
  39. # ssh -R *:2222:localhost:22 [email protected]
  40.  
  41. Pro pripojeni na PC:
  42. # ssh -p 2222 [email protected]
Advertisement
Add Comment
Please, Sign In to add comment