R
R
Rockman2017-01-06 23:01:22
ubuntu
Rockman, 2017-01-06 23:01:22

How to proxy a connection via SSH and others?

There is a VPS server with ip 1.2.3.4 it has access via SSH 1.2.3.4:22
There is a second VPS with ip 9.8.7.5 it has access via SSH
9.8.7.5:22 3333 (instead of 3333 there can be any other port) I got to the first server 1.2.3.4:22
That is, so that I can connect to the first server via SSH using the IP of the second server so that the first server does not know the connection source

Answer the question

In order to leave comments, you need to log in

2 answer(s)
1
15432, 2017-01-06
@1Rockman

Forward with any software for TCP tunneling ..
socat TCP-LISTEN:3333, TCP:1.2.3.4:22
you can also configure it via iptables (but here it seems the source will not change and the first server will send a direct response)
sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport 3333 -j DNAT --to-destination 1.2.3.4:22
iptables -t nat -A POSTROUTING -j MASQUERADE

D
Dimonchik, 2017-01-06
@dimonchik2013

https://putty.org.ru/articles/putty-ssh-tunnels.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question