Skip to content

Instantly share code, notes, and snippets.

@schnittchen
Created October 8, 2014 20:22
Show Gist options
  • Save schnittchen/a47e40760e804a5cc8b9 to your computer and use it in GitHub Desktop.
Save schnittchen/a47e40760e804a5cc8b9 to your computer and use it in GitHub Desktop.
"Tunneling" an ssh agent connection through into an lxc container (for bootstrapping)
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