Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Using ssh -R 9333:localhost:9333 remotehost.com

I'd like to be able to navigate to this via Chrome/Firefox/IE without have to use socks.

http://domain.com:9333

share|improve this question
    
I think you have your forwarding backwards. Which host is your server running on? –  CodeGnome Jan 5 '13 at 17:36
    
The dev-server is running locally on my machine. I'd like to push it to a foreign machine that is not behind a firewall. –  jbcurtin Jan 5 '13 at 17:46

1 Answer 1

up vote 1 down vote accepted

After "-R 9333:localhost:9333" your 9333 port forwards to 9333 of the lo0 of the remotehost. (lo0 is usally the localhost). So if you application listens 9333 on lo0, you can navigate it by simply typing on the ssh client side:

http://localhost:9333
share|improve this answer
    
How can I use eth0 rather the lo0? –  jbcurtin Jan 5 '13 at 17:52
    
"ssh -R 9333:remotehost.com:9333 remotehost.com". But you should check the name resolution of the 'remotehost.com' on the remotehost side: # host remotehost.com. You should also be sure than your application listens needed port: # netstat -na | grep :9333 –  dchirikov Jan 5 '13 at 18:00
    
tcp 0 0 127.0.0.1:9333 0.0.0.0:* LISTEN tcp6 0 0 ::1:9333 :::* LISTEN –  jbcurtin Jan 5 '13 at 18:04
    
I guess now I need to figure out how to access it from: domain.com:9333. Any thoughts? –  jbcurtin Jan 5 '13 at 18:04
    
If I got you right you should use -L instead or -R: ssh -L 9333:localhost:9333 remotehost.com and then navigate to http://localhost:9333 on the client side –  dchirikov Jan 5 '13 at 18:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.