Skip to content

Instantly share code, notes, and snippets.

@jackiect
Last active June 8, 2020 12:25
Show Gist options
  • Save jackiect/f97485ac6d3acc29bc98c009ccc7c600 to your computer and use it in GitHub Desktop.
Save jackiect/f97485ac6d3acc29bc98c009ccc7c600 to your computer and use it in GitHub Desktop.
#!/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
@jackiect
Copy link
Author

jackiect commented Apr 2, 2020

ssh -t docker-machine-dev 'docker exec -it tmux-alpine sh'

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