Skip to content
Docker Engine

SSH agent

Licobox exposes the host SSH agent through /run/host-services/ssh-auth.sock. Mount that socket into the container and point SSH_AUTH_SOCK at it.

Terminal window
docker run -it --rm \
-v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock \
-e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock \
alpine
  1. Start a shell in the container.
  2. Run ssh-add -l.
Terminal window
ssh-add -l

If keys are listed, the agent is forwarded. If not, confirm the socket exists on the host and that the mount is present in the container.