Accessing a remote machine with or without ssh tunneling

1

I just want to educate myself on an interesting issue here. When I curl a URL I get this error

curl "http://myserver:8888/payload"
curl: (7) couldn't connect to host

However when I setup a tunnel and curl via that tunnel it works. Tunnel command:

ssh -f myserver -L 8888:myserver:8888 -N

Curl works now:

curl "localhost:8888/payload"
Hi thr!

Is it the way things are setup by server admin or something else?

I posted this question on SO first but got kicked out from there :( https://stackoverflow.com/questions/21198847/accessing-a-remote-machine-with-or-without-ssh-tunneling

Richeek

Posted 2014-01-18T21:46:54.713

Reputation: 111

Answers

1

Most likely a firewall issue of some sort.

If it is the server's internal firewall you should be able to list the firewall rules with

iptables -L

this will show the various chains that are active on that machine right now for iptables (the linux firewall).

It might not be a firewall issue on the server itself it could be any firewall/router between you and it denying you access to that port. To test that try nmap from your local machine:

nmap -p 8888 server.hostname

that will test the 8888 port on the remote server to see if it is accessible from your machine

thoth

Posted 2014-01-18T21:46:54.713

Reputation: 121