Last active
June 8, 2020 12:25
-
-
Save jackiect/f97485ac6d3acc29bc98c009ccc7c600 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
result='\n' | |
for m in $(docker-machine ls -f '{{.Name}}') | |
do | |
result=$result"Host docker-machine-$(docker-machine inspect -f '{{.Driver.MachineName}}' $m)"'\n' | |
result=$result" HostName $(docker-machine inspect -f '{{.Driver.IPAddress}}' $m)"'\n' | |
result=$result" User $(docker-machine inspect -f '{{.Driver.SSHUser}}' $m)"'\n' | |
result=$result" IdentityFile $(docker-machine inspect -f '{{.Driver.SSHKeyPath}}' $m)"'\n' | |
result=$result" StrictHostKeyChecking no"'\n' | |
result=$result" LogLevel ERROR"'\n' | |
result=$result" UserKnownHostsFile /dev/null"'\n' | |
result=$result"# ControlPersist yes"'\n' | |
result=$result"# ControlMaster auto"'\n' | |
result=$result"# ControlPath ~/.ssh/master-%r@%h:%p"'\n' | |
result=$result"# ServerAliveInterval 90"'\n' | |
result=$result"# ServerAliveCountMax 10"'\n' | |
result=$result'\n' | |
done | |
echo -e -n $result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ssh -t docker-machine-dev 'docker exec -it tmux-alpine sh'