Created
October 8, 2014 20:22
-
-
Save schnittchen/a47e40760e804a5cc8b9 to your computer and use it in GitHub Desktop.
"Tunneling" an ssh agent connection through into an lxc container (for bootstrapping)
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
while :; do socat UNIX:$SSH_AUTH_SOCK EXEC:"lxc-attach -n $CONTAINER_NAME -- /usr/bin/socat STDIN UNIX-LISTEN\:/agent-sock"; done | |
# After entering the container the usual way using lxc-attach (from a separate host shell), set the SSH_AUTH_SOCK environment variable to "/agent-sock". | |
# Needs socat both on the host and in the container. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment