Skip to content

Instantly share code, notes, and snippets.

@mkmik
Last active August 7, 2018 23:33
Show Gist options
  • Save mkmik/43937687201db3062bf469467cf54859 to your computer and use it in GitHub Desktop.
Save mkmik/43937687201db3062bf469467cf54859 to your computer and use it in GitHub Desktop.
Instructions for using ssh keypair from a smartcard (e.g. yubi nano) from inside docker (e.g. inside cloudready chromiumos)
Instructions for using ssh keypair from a smartcard (e.g. yubi nano) from inside docker (e.g. inside cloudready chromiumos)
run a privileged container
$ docker run -ti --name foo --privileged ubuntu bash
Do once
$ apt-get install pcscd scdaemon gnupg2 pcsc-tools ssh
$ cat >>~/.gnupg/gpg-agent.conf <<EOF
pinentry-program /usr/bin/pinentry-curses
enable-ssh-support
default-cache-ttl 600
max-cache-ttl 7200
EOF
$ source <(echo 'export SSH_AUTH_SOCK=~/.gnupg/S.gpg-agent.ssh' | tee -a ~/.bashrc)
Every time:
$ gpgconf --launch gpg-agent
$ gpg-connect-agent updatestartuptty /bye # makes sure pinentry-ncurses works
@mkmik
Copy link
Author

mkmik commented Aug 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment