48 * Инсталируем openssh из Cygwin. |
48 * Инсталируем openssh из Cygwin. |
49 * В приглашении bash набираем |
49 * В приглашении bash набираем |
50 $ ssh user@192.168.1.38 |
50 $ ssh user@192.168.1.38 |
51 или |
51 или |
52 $ ssh -l user 192.168.1.38 |
52 $ ssh -l user 192.168.1.38 |
|
53 |
|
54 * Reverse SSH Tunneling |
|
55 |
|
56 Have you ever wanted to ssh to your Linux box that sits behind NAT? Now you can with |
|
57 reverse SSH tunneling. This document will show you step by step how to set up reverse SSH |
|
58 tunneling. The reverse SSH tunneling should work fine with Unix like systems. |
|
59 |
|
60 Let's assume that Destination's IP is 192.168.20.55 (Linux box that you want to access). |
|
61 |
|
62 You want to access from Linux client with IP 138.47.99.99. |
|
63 Destination (192.168.20.55) <- |NAT| <- Source (138.47.99.99) |
|
64 |
|
65 SH from the destination to the source (with public ip) using command below: |
|
66 |
|
67 $ ssh -R 19999:localhost:22 sourceuser@138.47.99.99 |
|
68 |
|
69 port 19999 can be any unused port. |
|
70 Now you can SSH from source to destination through SSH tuneling: |
|
71 |
|
72 $ ssh localhost -p 19999 |
|
73 |
|
74 3rd party servers can also access 192.168.20.55 through Destination (138.47.99.99). |
|
75 Destination (192.168.20.55) <- |NAT| <- Source (138.47.99.99) <- Bob's server |
|
76 |
|
77 From Bob's server: |
|
78 |
|
79 $ ssh sourceuser@138.47.99.99 |
|
80 |
|
81 After the sucessful login to Source: |
|
82 |
|
83 $ ssh localhost -p 19999 |
|
84 |
|
85 The connection between destination and source must be alive at all time. Tip: you may run |
|
86 a command (e.g. watch, top) on Destination to keep the connection active. |