Skip to content

Instantly share code, notes, and snippets.

@cybercypher
Last active September 14, 2022 11:49
Show Gist options
  • Save cybercypher/09034406f544e040b38bdec47effc006 to your computer and use it in GitHub Desktop.
Save cybercypher/09034406f544e040b38bdec47effc006 to your computer and use it in GitHub Desktop.
mobaxterm and vagrant ssh
vagrant() {
if [[ $@ == "ssh" ]]; then
command vagrant ssh-config > vagrant-ssh-config && ssh -A -F vagrant-ssh-config default
else
command vagrant "$@"
fi
}
vagrant() {
if [[ $1 == "ssh" ]]; then
BOX=default
if [[ ! -z "$2" ]]; then
BOX=$2
fi
command vagrant ssh-config > vagrant-ssh-config && ssh -A -F vagrant-ssh-config $BOX
else
command vagrant "$@"
fi
}
@dswitzer
Copy link

Nice!

@rohit135
Copy link

thanks

@martinwk
Copy link

martinwk commented Mar 3, 2017

Nice solution! Works fine for single machine setup, but fails with a multimachine setup. The argument 'default' should be changed to the name of the machine you want to reach. But my bashscripting skills are a little rusty; any advice to tackle this for multimachines?

@cybercypher
Copy link
Author

@Foxtrod89
Copy link

WARNING: This command has been deprecated in favor of vagrant cloud auth login
Usage: vagrant [options] []

@serheang
Copy link

Thanks. This just save me from more digging and diff between cygwin and mobaxterm.
By any chance, you know what is causing this behavior in mobaxterm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment