Difference between revisions of "Reverse SSH tunneling"

From wikieduonline
Jump to navigation Jump to search
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
* See also: <code>[[ssh -R]]</code>
 
* See also: <code>[[ssh -R]]</code>
 +
* TOMERGE: [[ssh tunnel]]
  
1) Create tunnel
 
[[ssh -f]] [[-N]] [[ssh -T|-T]] [[-R]]22222:localhost:22 yourpublichost.example.com
 
  
[[ssh -fNT]] -R2222:localhost:22 [email protected]
+
1) Create remote port forwarding
 +
  [[ssh -f]] [[-N]] [[ssh -T|-T]] [[-R]]2222:localhost:22 $([[hostname -i]])
  
Connect  
+
  [[ssh -f]] [[-N]] [[ssh -T|-T]] [[-R]]2222:localhost:22 [[yourmachineip]].example.com or
  [[ssh -p]]
+
 
 +
  [[ssh -fNT]] -R2222:localhost:22 [email protected]
 +
 
 +
  -T Disable pseudo-terminal allocation.
 +
 
 +
 
 +
 
 +
2) Connect  
 +
  [[ssh -p]] 2222 localhost
  
  
Line 14: Line 22:
 
   
 
   
 
  Solution: -R2222243653 review you do not exceed size of port.
 
  Solution: -R2222243653 review you do not exceed size of port.
 
  
 
  [[kex_exchange_identification: read: Connection reset by peer]]
 
  [[kex_exchange_identification: read: Connection reset by peer]]
Line 23: Line 30:
 
== Related ==
 
== Related ==
 
* <code>[[ifconfig -a]]</code>
 
* <code>[[ifconfig -a]]</code>
* [[ssh -f -N -T]]
+
* <code>[[ssh -f -N -T]]</code>
* [[ssh -p]]
+
* <code>[[ssh -p]]</code>
 
* [[Port forwarding]]
 
* [[Port forwarding]]
* [[ssh tunnel]]
+
* <code>[[ssh tunnel]]</code>
 +
* <code>[[myip]]</code>
 +
* <code>[[ip route add]]</code>
 +
* [[nping]]
  
 
== See also ==
 
== See also ==
 +
* {{ssh -R}}
 
* {{ssh}}
 
* {{ssh}}
  
 
[[Category:SSH]]
 
[[Category:SSH]]

Latest revision as of 14:02, 22 January 2024


1) Create remote port forwarding

 ssh -f -N -T -R2222:localhost:22 $(hostname -i)
 ssh -f -N -T -R2222:localhost:22 yourmachineip.example.com or 
 ssh -fNT -R2222:localhost:22 [email protected]
  -T Disable pseudo-terminal allocation.


2) Connect

ssh -p 2222 localhost


Error[edit]

Bad remote forwarding specification

Solution: -R2222243653 review you do not exceed size of port.
kex_exchange_identification: read: Connection reset by peer

Activities[edit]

Related[edit]

See also[edit]

Advertising: