Skip to content

Instantly share code, notes, and snippets.

@drewsonne
Forked from neilk/vagrant-ssh-node
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewsonne/747b1ce77cc2f912af0f to your computer and use it in GitHub Desktop.
Save drewsonne/747b1ce77cc2f912af0f to your computer and use it in GitHub Desktop.
#!/bin/bash
# SSH into a Vagrant VM, forwarding ports in a way that allows node within Vagrant to be debugged by a debugger
# or IDE in the host operating system. Don't know why, but Vagrantfile port forwarding does not work.
# (https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q)
# Usage:
# vagrant-ssh-node [port]
PORT="$1"
/usr/bin/vagrant ssh-config > $TMPDIR/vagrant-ssh-config
ssh -F $TMPDIR/vagrant-ssh-config -L $PORT:127.0.0.1:$PORT default
rm $TMPDIR/vagrant-ssh-config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment