msimonin / vagrant-g5k

Hacking around vagrant and g5k
MIT License
3 stars 1 forks source link

Port forwarding #4

Closed david-guyon closed 8 years ago

david-guyon commented 8 years ago

Hi Matthieu,

Let's say I have a web application running on my VM on port 8080 and I want to get an access to this app from the outside. According to this line I can write something like:

g5k.ports = ['2222-:22', '8080-:8080']

Now my VM should forward its 8080 port to its host (a g5k node). With a SSH tunnel I should be able to access that application with something like:

ssh -NL 8080:myNode.theSite.g5k:8080 myUsername@myNode.theSite.g5k

Unfortunatly I'm getting this error each time I try to access the page:

channel 2: open failed: administratively prohibited: open failed

My few questions:

Because others may need this feature, it would be great to give an example in the README file. Thanks in advance.

msimonin commented 8 years ago

You're not mistaken and it should work. Can you try with the following tunnel creation :

ssh -NL 8080:parapluie-1.rennes.grid5000.fr:8080 access.grid5000.fr

asssuming parapluie-1 is the node hosting the VM.

david-guyon commented 8 years ago

Like this it is not working, I changed access.grid5000.fr to access.g5k in order to use my SSH configuration. Now I don't get the Permission denied (publickey) error. In the end my command looks like this:

ssh -NL 8080:taurus-6.lyon.grid5000.fr:8080 access.g5k

It works pretty well. Thank you for the quick answer!

msimonin commented 8 years ago

Glad to see it works ! :)