Last active
November 26, 2020 01:03
-
-
Save iqueryable/475c9c73f539b7a3a89ad5525fb87512 to your computer and use it in GitHub Desktop.
This file contains 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
# SSH agent forward as root user | |
docker run --rm -it \ | |
-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK \ | |
-e SSH_AUTH_SOCK=$SSH_AUTH_SOCK \ | |
ubuntu:20.04 /bin/bash | |
# SSH agent forward as non-root user | |
docker run --rm -it \ | |
-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK \ | |
-e SSH_AUTH_SOCK=$SSH_AUTH_SOCK \ | |
-e UID=$(id -u) \ | |
ubuntu:20.04 /bin/bash -c 'useradd -m -u $UID non-root -s /bin/bash; su non-root;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment