- сгенерировал sub SEA
gpg --list-keys --with-keygrip
sub rsa4096 2023-10-05 [SEA]
Keygrip = some_key
- добавил ssh support
echo enable-ssh-support >> $HOME/.gnupg/gpg-agent.conf
- добавил ключ в
echo some_key >> ~/.gnupg/sshcontrol
- Проверил ключ
ssh-add -l
4096 SHA256:4/some/some (none) (RSA)
- добавил в .bashrc
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null
- добавил ключ в bitbucket
gpg --export-ssh-key some_some@some.com
- делаю git push и получаю:
git push
sign_and_send_pubkey: signing failed for RSA "(none)" from agent: agent refused operation
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Конфиг gpg-agent
cat ~/.gnupg/gpg-agent.conf
default-cache-ttl 34560000 # 400 day
max-cache-ttl 34560000 # 400 day
allow-loopback-pinentry
pinentry-program pinentry-gtk-2
enable-ssh-support
Подозреваю, что не запускается pinentry. Как это починить?
ssh -vT git@bitbucket.org
out:
debug1: get_agent_identities: agent returned 1 keys
debug1: Will attempt key: (none) RSA SHA256:4/some/some agent
debug1: Will attempt key: /home/user/.ssh/id_rsa
debug1: Will attempt key: /home/user/.ssh/id_ecdsa
debug1: Will attempt key: /home/user/.ssh/id_ecdsa_sk
debug1: Will attempt key: /home/user/.ssh/id_ed25519
debug1: Will attempt key: /home/user/.ssh/id_ed25519_sk
debug1: Will attempt key: /home/user/.ssh/id_xmss
debug1: Will attempt key: /home/user/.ssh/id_dsa
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ecdsa-sha2-nistp256,ecdsa-sha2-nistp521,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-rsa,rsa-sha2-256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,rsa-sha2-512,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: (none) RSA SHA256:4/some/some agent
debug1: Server accepts key: (none) RSA SHA256:4/some agent
sign_and_send_pubkey: signing failed for RSA "(none)" from agent: agent refused operation
debug1: Trying private key: /home/user/.ssh/id_rsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/user/.ssh/id_ed25519
debug1: Trying private key: /home/user/.ssh/id_ed25519_sk
debug1: Trying private key: /home/user/.ssh/id_xmss
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: No more authentication methods to try.
git@bitbucket.org: Permission denied (publickey).
Если сделать в терминале, то всё ок(но спрашивает не в указанном пинентри, а в терминале). После уже работает git push
echo "Test" | gpg2 -s
Как бы сделать так, чтобы при старте WM gpg2 спрашивало пароль?