How to create SSH reverse tunnel with iptables forwarding?ssh tunnel/forwarding & iptablesngircd refuses connection over ssh tunnelRemote SSH Tunnel not working with certificatesAccessing forwarded port via SSL/TLSLinux iptables ssh port forwarding (martian rejection)wget probelm with a tunnel connection using sshSSH Tunnel “channel x: open failed: connect failed: Connection timed out”Port prerouting only in case of my IP, not othersI can't make a SSH tunnel successfully inside a docker containerSSH session through jumphost via remote port forwardingPort forwarding over OpenVpn
Do sorcerers' Subtle Spells require a skill check to be unseen?
Why not increase contact surface when reentering the atmosphere?
Different result between scanning in Epson's "color negative film" mode and scanning in positive -> invert curve in post?
Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?
Short story about space worker geeks who zone out by 'listening' to radiation from stars
Is there a good way to store credentials outside of a password manager?
Why are there no referendums in the US?
Method to test if a number is a perfect power?
How does buying out courses with grant money work?
How do I find the solutions of the following equation?
Roman Numeral Treatment of Suspensions
How easy is it to start Magic from scratch?
How does it work when somebody invests in my business?
Escape a backup date in a file name
How do I rename a Linux host without needing to reboot for the rename to take effect?
How did Doctor Strange see the winning outcome in Avengers: Infinity War?
Unreliable Magic - Is it worth it?
Pole-zeros of a real-valued causal FIR system
Opposite of a diet
How to safely derail a train during transit?
Is there a problem with hiding "forgot password" until it's needed?
Tiptoe or tiphoof? Adjusting words to better fit fantasy races
How to be diplomatic in refusing to write code that breaches the privacy of our users
Two monoidal structures and copowering
How to create SSH reverse tunnel with iptables forwarding?
ssh tunnel/forwarding & iptablesngircd refuses connection over ssh tunnelRemote SSH Tunnel not working with certificatesAccessing forwarded port via SSL/TLSLinux iptables ssh port forwarding (martian rejection)wget probelm with a tunnel connection using sshSSH Tunnel “channel x: open failed: connect failed: Connection timed out”Port prerouting only in case of my IP, not othersI can't make a SSH tunnel successfully inside a docker containerSSH session through jumphost via remote port forwardingPort forwarding over OpenVpn
I have a server in my home network (cannot port forward) and a VPS on the WAN. I need requests on a certain port, to, not from, the VPS to be forwarded to my home server. I have an SSH tunnel which works fine if I send the request to localhost
on VPS. However I want requests forwarded to VPS's localhost
from internet be sent to my home server through the tunnel. And it needs to be bi-directional.
I have seen this question, however it doesn't work for me. It is quite possible that I did something incorrectly.
My exact procedure:
On server a
, my home server, I ran this command to set up the tunnel:
ssh -v -N -R 2222:localhost:22 root@server-b.com
I ran the following command on server b
(VPS):
iptables -t nat -A PREROUTING -p tcp --dport 2223 -j DNAT --to-destination 127.0.0.1:2222
And tried to ssh
from another machine:
ssh root@server-b.com -p 2223
I set GatewayPorts yes
in sshd_config
however I am still finding the same problem:
ssh: connect to host server-b.com port 2223: Connection refused.
linux ssh iptables ssh-tunneling
add a comment |
I have a server in my home network (cannot port forward) and a VPS on the WAN. I need requests on a certain port, to, not from, the VPS to be forwarded to my home server. I have an SSH tunnel which works fine if I send the request to localhost
on VPS. However I want requests forwarded to VPS's localhost
from internet be sent to my home server through the tunnel. And it needs to be bi-directional.
I have seen this question, however it doesn't work for me. It is quite possible that I did something incorrectly.
My exact procedure:
On server a
, my home server, I ran this command to set up the tunnel:
ssh -v -N -R 2222:localhost:22 root@server-b.com
I ran the following command on server b
(VPS):
iptables -t nat -A PREROUTING -p tcp --dport 2223 -j DNAT --to-destination 127.0.0.1:2222
And tried to ssh
from another machine:
ssh root@server-b.com -p 2223
I set GatewayPorts yes
in sshd_config
however I am still finding the same problem:
ssh: connect to host server-b.com port 2223: Connection refused.
linux ssh iptables ssh-tunneling
1
It would be useful documenting in your own post exactly what was done
– Rui F Ribeiro
Mar 3 at 13:32
You might want to look at theGatewayPorts
setting on the VPS serversshd_config
. This can allow the remote port 2222 to bind to all IP addresses and so be visible without NATting.
– Stephen Harris
Mar 3 at 16:39
@StephenHarris I'll check that out. Thanks
– Jachdich
Mar 3 at 17:05
@StephenHarris sorry for the inactivity but it didn't work. I setGatewayPorts
toyes
however it is still not functioning.
– Jachdich
Mar 8 at 18:46
add a comment |
I have a server in my home network (cannot port forward) and a VPS on the WAN. I need requests on a certain port, to, not from, the VPS to be forwarded to my home server. I have an SSH tunnel which works fine if I send the request to localhost
on VPS. However I want requests forwarded to VPS's localhost
from internet be sent to my home server through the tunnel. And it needs to be bi-directional.
I have seen this question, however it doesn't work for me. It is quite possible that I did something incorrectly.
My exact procedure:
On server a
, my home server, I ran this command to set up the tunnel:
ssh -v -N -R 2222:localhost:22 root@server-b.com
I ran the following command on server b
(VPS):
iptables -t nat -A PREROUTING -p tcp --dport 2223 -j DNAT --to-destination 127.0.0.1:2222
And tried to ssh
from another machine:
ssh root@server-b.com -p 2223
I set GatewayPorts yes
in sshd_config
however I am still finding the same problem:
ssh: connect to host server-b.com port 2223: Connection refused.
linux ssh iptables ssh-tunneling
I have a server in my home network (cannot port forward) and a VPS on the WAN. I need requests on a certain port, to, not from, the VPS to be forwarded to my home server. I have an SSH tunnel which works fine if I send the request to localhost
on VPS. However I want requests forwarded to VPS's localhost
from internet be sent to my home server through the tunnel. And it needs to be bi-directional.
I have seen this question, however it doesn't work for me. It is quite possible that I did something incorrectly.
My exact procedure:
On server a
, my home server, I ran this command to set up the tunnel:
ssh -v -N -R 2222:localhost:22 root@server-b.com
I ran the following command on server b
(VPS):
iptables -t nat -A PREROUTING -p tcp --dport 2223 -j DNAT --to-destination 127.0.0.1:2222
And tried to ssh
from another machine:
ssh root@server-b.com -p 2223
I set GatewayPorts yes
in sshd_config
however I am still finding the same problem:
ssh: connect to host server-b.com port 2223: Connection refused.
linux ssh iptables ssh-tunneling
linux ssh iptables ssh-tunneling
edited yesterday


Irfan Latif
1285
1285
asked Mar 3 at 13:30
JachdichJachdich
133
133
1
It would be useful documenting in your own post exactly what was done
– Rui F Ribeiro
Mar 3 at 13:32
You might want to look at theGatewayPorts
setting on the VPS serversshd_config
. This can allow the remote port 2222 to bind to all IP addresses and so be visible without NATting.
– Stephen Harris
Mar 3 at 16:39
@StephenHarris I'll check that out. Thanks
– Jachdich
Mar 3 at 17:05
@StephenHarris sorry for the inactivity but it didn't work. I setGatewayPorts
toyes
however it is still not functioning.
– Jachdich
Mar 8 at 18:46
add a comment |
1
It would be useful documenting in your own post exactly what was done
– Rui F Ribeiro
Mar 3 at 13:32
You might want to look at theGatewayPorts
setting on the VPS serversshd_config
. This can allow the remote port 2222 to bind to all IP addresses and so be visible without NATting.
– Stephen Harris
Mar 3 at 16:39
@StephenHarris I'll check that out. Thanks
– Jachdich
Mar 3 at 17:05
@StephenHarris sorry for the inactivity but it didn't work. I setGatewayPorts
toyes
however it is still not functioning.
– Jachdich
Mar 8 at 18:46
1
1
It would be useful documenting in your own post exactly what was done
– Rui F Ribeiro
Mar 3 at 13:32
It would be useful documenting in your own post exactly what was done
– Rui F Ribeiro
Mar 3 at 13:32
You might want to look at the
GatewayPorts
setting on the VPS server sshd_config
. This can allow the remote port 2222 to bind to all IP addresses and so be visible without NATting.– Stephen Harris
Mar 3 at 16:39
You might want to look at the
GatewayPorts
setting on the VPS server sshd_config
. This can allow the remote port 2222 to bind to all IP addresses and so be visible without NATting.– Stephen Harris
Mar 3 at 16:39
@StephenHarris I'll check that out. Thanks
– Jachdich
Mar 3 at 17:05
@StephenHarris I'll check that out. Thanks
– Jachdich
Mar 3 at 17:05
@StephenHarris sorry for the inactivity but it didn't work. I set
GatewayPorts
to yes
however it is still not functioning.– Jachdich
Mar 8 at 18:46
@StephenHarris sorry for the inactivity but it didn't work. I set
GatewayPorts
to yes
however it is still not functioning.– Jachdich
Mar 8 at 18:46
add a comment |
1 Answer
1
active
oldest
votes
Set GatewayPorts yes
and AllowTcpForwarding yes
in sshd_config
on server b
. With GatewayPorts clientspecified
explicitly mention IP 0.0.0.0
or *
on server a
to create reverse tunnel. So that sshd on server b
accepts connections from public too:
ssh -NTR *:2222:localhost:22 root@server-b.com
Otherwise sshd listens on loopback interface only as is the case with GatewayPorts no
.
Now ssh
from another machine to port 2222
:
ssh root@server-b.com -p 2222
You'll be logged in to server a
after authentication.
No need to set up iptables
forwarding. Btw, avoid user root
for remote logins, if possible.
If you don't want to set GatewayPorts
option, then you need to forward traffic from some other port, say 2223
, to localhost:2222
.
This can be done with
iptables
on serverb
:iptables -t nat -I PREROUTING -p tcp -m tcp --dport 2223 -j DNAT --to-destination 127.0.0.1:2222
*
REDIRECT
works only for same interfaceBut routing to
loopback
interface isn't allowed unless:echo 1 | sudo tee /proc/sys/net/ipv4/conf/all/route_localnet
Now
ssh
from another machine to port2223
:ssh root@server-b.com -p 2223
Another option is to setup some minimal local forwarding server from port 2223
to 2222
using tools like ssh
, socat
, netcat
, *inetd
etc.
On server
b
, withsocat
:socat TCP-LISTEN:2223,fork TCP:127.0.0.1:2222
Or with
netcat
:nc -l -p 2223 -c "nc 127.0.0.1 2222"
Or with
ssh
:ssh -4gfNTL 2223:localhost:2222 localhost
Any of the above can be combined with reverse tunnel to do a double forwarding from server a
in a single step:
ssh -TR *:2222:localhost:22 root@server-b.com "ssh -4gfNTL 2223:localhost:2222 localhost"
New contributor
Irfan Latif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Thanks, I shall try this soon. About root, I've just been too lazy to make a normal user account. Probably should do that soon.
– Jachdich
2 days ago
OH MY GOD IT WORKS! I cannot thank you enough. I've been searching for this for months and it is everything I need. Thanks again
– Jachdich
2 days ago
You are welcome. I have extended the answer to include other possible options, includingiptables
if you want to go for that.
– Irfan Latif
2 days ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504100%2fhow-to-create-ssh-reverse-tunnel-with-iptables-forwarding%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Set GatewayPorts yes
and AllowTcpForwarding yes
in sshd_config
on server b
. With GatewayPorts clientspecified
explicitly mention IP 0.0.0.0
or *
on server a
to create reverse tunnel. So that sshd on server b
accepts connections from public too:
ssh -NTR *:2222:localhost:22 root@server-b.com
Otherwise sshd listens on loopback interface only as is the case with GatewayPorts no
.
Now ssh
from another machine to port 2222
:
ssh root@server-b.com -p 2222
You'll be logged in to server a
after authentication.
No need to set up iptables
forwarding. Btw, avoid user root
for remote logins, if possible.
If you don't want to set GatewayPorts
option, then you need to forward traffic from some other port, say 2223
, to localhost:2222
.
This can be done with
iptables
on serverb
:iptables -t nat -I PREROUTING -p tcp -m tcp --dport 2223 -j DNAT --to-destination 127.0.0.1:2222
*
REDIRECT
works only for same interfaceBut routing to
loopback
interface isn't allowed unless:echo 1 | sudo tee /proc/sys/net/ipv4/conf/all/route_localnet
Now
ssh
from another machine to port2223
:ssh root@server-b.com -p 2223
Another option is to setup some minimal local forwarding server from port 2223
to 2222
using tools like ssh
, socat
, netcat
, *inetd
etc.
On server
b
, withsocat
:socat TCP-LISTEN:2223,fork TCP:127.0.0.1:2222
Or with
netcat
:nc -l -p 2223 -c "nc 127.0.0.1 2222"
Or with
ssh
:ssh -4gfNTL 2223:localhost:2222 localhost
Any of the above can be combined with reverse tunnel to do a double forwarding from server a
in a single step:
ssh -TR *:2222:localhost:22 root@server-b.com "ssh -4gfNTL 2223:localhost:2222 localhost"
New contributor
Irfan Latif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Thanks, I shall try this soon. About root, I've just been too lazy to make a normal user account. Probably should do that soon.
– Jachdich
2 days ago
OH MY GOD IT WORKS! I cannot thank you enough. I've been searching for this for months and it is everything I need. Thanks again
– Jachdich
2 days ago
You are welcome. I have extended the answer to include other possible options, includingiptables
if you want to go for that.
– Irfan Latif
2 days ago
add a comment |
Set GatewayPorts yes
and AllowTcpForwarding yes
in sshd_config
on server b
. With GatewayPorts clientspecified
explicitly mention IP 0.0.0.0
or *
on server a
to create reverse tunnel. So that sshd on server b
accepts connections from public too:
ssh -NTR *:2222:localhost:22 root@server-b.com
Otherwise sshd listens on loopback interface only as is the case with GatewayPorts no
.
Now ssh
from another machine to port 2222
:
ssh root@server-b.com -p 2222
You'll be logged in to server a
after authentication.
No need to set up iptables
forwarding. Btw, avoid user root
for remote logins, if possible.
If you don't want to set GatewayPorts
option, then you need to forward traffic from some other port, say 2223
, to localhost:2222
.
This can be done with
iptables
on serverb
:iptables -t nat -I PREROUTING -p tcp -m tcp --dport 2223 -j DNAT --to-destination 127.0.0.1:2222
*
REDIRECT
works only for same interfaceBut routing to
loopback
interface isn't allowed unless:echo 1 | sudo tee /proc/sys/net/ipv4/conf/all/route_localnet
Now
ssh
from another machine to port2223
:ssh root@server-b.com -p 2223
Another option is to setup some minimal local forwarding server from port 2223
to 2222
using tools like ssh
, socat
, netcat
, *inetd
etc.
On server
b
, withsocat
:socat TCP-LISTEN:2223,fork TCP:127.0.0.1:2222
Or with
netcat
:nc -l -p 2223 -c "nc 127.0.0.1 2222"
Or with
ssh
:ssh -4gfNTL 2223:localhost:2222 localhost
Any of the above can be combined with reverse tunnel to do a double forwarding from server a
in a single step:
ssh -TR *:2222:localhost:22 root@server-b.com "ssh -4gfNTL 2223:localhost:2222 localhost"
New contributor
Irfan Latif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Thanks, I shall try this soon. About root, I've just been too lazy to make a normal user account. Probably should do that soon.
– Jachdich
2 days ago
OH MY GOD IT WORKS! I cannot thank you enough. I've been searching for this for months and it is everything I need. Thanks again
– Jachdich
2 days ago
You are welcome. I have extended the answer to include other possible options, includingiptables
if you want to go for that.
– Irfan Latif
2 days ago
add a comment |
Set GatewayPorts yes
and AllowTcpForwarding yes
in sshd_config
on server b
. With GatewayPorts clientspecified
explicitly mention IP 0.0.0.0
or *
on server a
to create reverse tunnel. So that sshd on server b
accepts connections from public too:
ssh -NTR *:2222:localhost:22 root@server-b.com
Otherwise sshd listens on loopback interface only as is the case with GatewayPorts no
.
Now ssh
from another machine to port 2222
:
ssh root@server-b.com -p 2222
You'll be logged in to server a
after authentication.
No need to set up iptables
forwarding. Btw, avoid user root
for remote logins, if possible.
If you don't want to set GatewayPorts
option, then you need to forward traffic from some other port, say 2223
, to localhost:2222
.
This can be done with
iptables
on serverb
:iptables -t nat -I PREROUTING -p tcp -m tcp --dport 2223 -j DNAT --to-destination 127.0.0.1:2222
*
REDIRECT
works only for same interfaceBut routing to
loopback
interface isn't allowed unless:echo 1 | sudo tee /proc/sys/net/ipv4/conf/all/route_localnet
Now
ssh
from another machine to port2223
:ssh root@server-b.com -p 2223
Another option is to setup some minimal local forwarding server from port 2223
to 2222
using tools like ssh
, socat
, netcat
, *inetd
etc.
On server
b
, withsocat
:socat TCP-LISTEN:2223,fork TCP:127.0.0.1:2222
Or with
netcat
:nc -l -p 2223 -c "nc 127.0.0.1 2222"
Or with
ssh
:ssh -4gfNTL 2223:localhost:2222 localhost
Any of the above can be combined with reverse tunnel to do a double forwarding from server a
in a single step:
ssh -TR *:2222:localhost:22 root@server-b.com "ssh -4gfNTL 2223:localhost:2222 localhost"
New contributor
Irfan Latif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Set GatewayPorts yes
and AllowTcpForwarding yes
in sshd_config
on server b
. With GatewayPorts clientspecified
explicitly mention IP 0.0.0.0
or *
on server a
to create reverse tunnel. So that sshd on server b
accepts connections from public too:
ssh -NTR *:2222:localhost:22 root@server-b.com
Otherwise sshd listens on loopback interface only as is the case with GatewayPorts no
.
Now ssh
from another machine to port 2222
:
ssh root@server-b.com -p 2222
You'll be logged in to server a
after authentication.
No need to set up iptables
forwarding. Btw, avoid user root
for remote logins, if possible.
If you don't want to set GatewayPorts
option, then you need to forward traffic from some other port, say 2223
, to localhost:2222
.
This can be done with
iptables
on serverb
:iptables -t nat -I PREROUTING -p tcp -m tcp --dport 2223 -j DNAT --to-destination 127.0.0.1:2222
*
REDIRECT
works only for same interfaceBut routing to
loopback
interface isn't allowed unless:echo 1 | sudo tee /proc/sys/net/ipv4/conf/all/route_localnet
Now
ssh
from another machine to port2223
:ssh root@server-b.com -p 2223
Another option is to setup some minimal local forwarding server from port 2223
to 2222
using tools like ssh
, socat
, netcat
, *inetd
etc.
On server
b
, withsocat
:socat TCP-LISTEN:2223,fork TCP:127.0.0.1:2222
Or with
netcat
:nc -l -p 2223 -c "nc 127.0.0.1 2222"
Or with
ssh
:ssh -4gfNTL 2223:localhost:2222 localhost
Any of the above can be combined with reverse tunnel to do a double forwarding from server a
in a single step:
ssh -TR *:2222:localhost:22 root@server-b.com "ssh -4gfNTL 2223:localhost:2222 localhost"
New contributor
Irfan Latif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited yesterday
New contributor
Irfan Latif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Mar 25 at 2:48


Irfan LatifIrfan Latif
1285
1285
New contributor
Irfan Latif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Irfan Latif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Irfan Latif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Thanks, I shall try this soon. About root, I've just been too lazy to make a normal user account. Probably should do that soon.
– Jachdich
2 days ago
OH MY GOD IT WORKS! I cannot thank you enough. I've been searching for this for months and it is everything I need. Thanks again
– Jachdich
2 days ago
You are welcome. I have extended the answer to include other possible options, includingiptables
if you want to go for that.
– Irfan Latif
2 days ago
add a comment |
Thanks, I shall try this soon. About root, I've just been too lazy to make a normal user account. Probably should do that soon.
– Jachdich
2 days ago
OH MY GOD IT WORKS! I cannot thank you enough. I've been searching for this for months and it is everything I need. Thanks again
– Jachdich
2 days ago
You are welcome. I have extended the answer to include other possible options, includingiptables
if you want to go for that.
– Irfan Latif
2 days ago
Thanks, I shall try this soon. About root, I've just been too lazy to make a normal user account. Probably should do that soon.
– Jachdich
2 days ago
Thanks, I shall try this soon. About root, I've just been too lazy to make a normal user account. Probably should do that soon.
– Jachdich
2 days ago
OH MY GOD IT WORKS! I cannot thank you enough. I've been searching for this for months and it is everything I need. Thanks again
– Jachdich
2 days ago
OH MY GOD IT WORKS! I cannot thank you enough. I've been searching for this for months and it is everything I need. Thanks again
– Jachdich
2 days ago
You are welcome. I have extended the answer to include other possible options, including
iptables
if you want to go for that.– Irfan Latif
2 days ago
You are welcome. I have extended the answer to include other possible options, including
iptables
if you want to go for that.– Irfan Latif
2 days ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504100%2fhow-to-create-ssh-reverse-tunnel-with-iptables-forwarding%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
It would be useful documenting in your own post exactly what was done
– Rui F Ribeiro
Mar 3 at 13:32
You might want to look at the
GatewayPorts
setting on the VPS serversshd_config
. This can allow the remote port 2222 to bind to all IP addresses and so be visible without NATting.– Stephen Harris
Mar 3 at 16:39
@StephenHarris I'll check that out. Thanks
– Jachdich
Mar 3 at 17:05
@StephenHarris sorry for the inactivity but it didn't work. I set
GatewayPorts
toyes
however it is still not functioning.– Jachdich
Mar 8 at 18:46