1

I've setup a remote ssh tunnel from my Raspberry Pi, which is behind a NAT, to my vServer using the follow command:

ssh -ngNTfR 62.75.145.118:2209:localhost:22 [email protected]

62.75.145.118 is the A record of unkn0wn3d.com

I've set

GatewayPorts clientspecified

on unkn0wn3d.com sshd_config.

When I now try to connect directly to my Pi via

ssh [email protected] -p 2209

it says

ssh: connect to host unkn0wn3d.com port 2209: Connection refused

Netstat outputs

# netstat -a | grep 2209
tcp        0      0 localhost.localdom:2209 *:*                     LISTEN

Edit:

iptables output:

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

I've set the GatewayPorts to clientspecified on the vServer. The Raspberry Pi has Gatewayports still set to no.

I can reproduce the issue, the errors remain the same.

3
  • It sounds like a firewall issue, post the iptables ouput from your vServer. Also check the auth log on the vServer.
    – user351171
    Apr 24, 2016 at 15:42
  • Something doesn't add up. The netstat output in your question is what would be expected in case the configuration said GatewayPorts no. Could you go over the debugging steps mentioned in your question again and verify that you can in fact reproduce it as described? Are you certain you edited sshd_config on the correct server and reloaded the configuration file afterwards?
    – kasperd
    Apr 24, 2016 at 15:56
  • Updated the question.
    – Unkn0wn
    Apr 24, 2016 at 17:26

1 Answer 1

0

Got it working. I had a MatchUser Rule a few lines above the GatewayPorts and it looks like it was causing the issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .