Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh-add -s $PREFIX/lib/libtergent.so asks for a PIN #19

Open
nomeata opened this issue Mar 22, 2023 · 1 comment
Open

ssh-add -s $PREFIX/lib/libtergent.so asks for a PIN #19

nomeata opened this issue Mar 22, 2023 · 1 comment

Comments

@nomeata
Copy link

nomeata commented Mar 22, 2023

I noticed that I can use tergent with ssh-agent just fine: #15 (comment)

But ssh-add -s $PREFIX/lib/libtergent.so asks for a PIN (empty pin is fine), which doesn't make much sense to me, and makes it harder to include that setup in an automated startup script.

Why does ssh-add ask for a PIN here, and can it be avoided?

@eggbean
Copy link

eggbean commented Nov 6, 2023

Maybe PKCS#11 cards usually have a PIN number and ssh-agent expects that?

But in my case it's asking for a passphrase, not pin. I have dealt with this minor annoyance using an expect script.

I have this in my .zshenv:

# ssh-agent (Android)
if [[ $(uname -o) == Android ]]; then
  if [[ -z $SSH_AGENT_PID ]]; then
    eval $(ssh-agent -s) >/dev/null
    expect ~/.dotfiles/bin/android/ssh-agent-tergent.exp >/dev/null
  fi
fi

And the expect script:

#!/data/data/com.termux/files/usr/bin/expect

spawn ssh-add -s /data/data/com.termux/files/usr/lib/libtergent.so
expect -exact "Enter passphrase for PKCS\#11:"
send -- "foobar\r"
expect eof

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants