Created
October 5, 2018 20:05
-
-
Save Roadmaster/08c44bf715feb80017720317bbdfd42f to your computer and use it in GitHub Desktop.
how to ssh into local lxd containers
This file contains hidden or 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
# snippet for .ssh/config | |
Host *.lxd | |
#User ubuntu | |
#StrictHostKeyChecking no | |
#UserKnownHostsFile /dev/null | |
ProxyCommand nc $(lxc list --format csv -c s4 $(echo %h | sed "s/\.lxd//g") %h | python3 -c "import csv,sys; print([ip for ip in [e.split('\n') for s,e in list(csv.reader(sys.stdin)) if s == 'RUNNING'][0] if | |
'eth' in ip][0].split(' ')[0])") %p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment