1

I had at home an NAS and in the datacenter a Server. I make an SSH Tunnel with the following command:

autossh -fN -M20404 -R 1337:localhost:22 user@server

(from the nas to the server) Its working and I can access the NAS. Now, I want access the munin-node, also I make a new tunnel from the server to the nas:

ssh -N -R 49499:localhost:4949 localhost -p 1337

but if I make an nmap localhost -p 49499 the port is closed and i cant access the munin-node.

I don't know why and I am very happy about your help.

2
  • To be sure I understand well: The autossh command is executed on the NAS, the ssh command is executed on the server, and the nmap command is executed on the NAS? Is the munin-node also on the server?
    – uloBasEI
    Apr 15, 2012 at 11:43
  • autossh executed on the nas, ssh executed on the server, nmap executed on the server - munin-node runs on nas and the munin-server on the server :) Apr 15, 2012 at 13:30

1 Answer 1

0

If you would like to access your munin-node running on your NAS from your server, you should use in your ssh command a direct port forwarding with -L instead of a reverse port forwarding with -R:

On the NAS:

nas $ autossh -fN -M20404 -R 1337:localhost:22 user@server

On the server:

server $ ssh -N -L 49499:localhost:4949 localhost -p 1337

Then from your server, telnet localhost 49499 should connect to your munin-node on the NAS.

If you don't need your autossh command for something else, you could simplify everything with only one command on your NAS:

nas $ autossh -fN -M20404 -R 49499:localhost:4949 user@server

Then again on the server, you can access the munin-node of your NAS with telnet localhost 49499 as well, through the SSH tunnel.

1
  • You are right! I am so stupid. Its so easy! Many thanks! Apr 15, 2012 at 16:29

You must log in to answer this question.

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