Created
September 17, 2015 11:14
-
-
Save rubensdev/5ef68f5090460c5197a5 to your computer and use it in GitHub Desktop.
Speed up vagrant SSH access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# fastssh.sh | |
hostname=default | |
function fastssh() { | |
if [ ! -e .vagrant-ssh ]; then | |
vagrant ssh-config $hostname | ssh -t -t -F/dev/stdin -o 'ControlMaster auto' -o 'ControlPath .vagrant-ssh' -f -N $hostname | |
fi | |
ssh -o 'ControlMaster auto' -o 'ControlPath .vagrant-ssh' $hostname "$@" | |
} | |
fastssh "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment