I'm SSHing into my mac and doing some stuff remotely through tmux (namely uploading some stuff to github). When I just tried to run a git push
, my command kept stalling silently. I found ssh stalling on this message, debug1: key_parse_private_pem: PEM_read_PrivateKey failed
, and divined that the password prompt was being caught by the Keychain app and being displayed on the screen. I was able to get it to go through by using teamviewer to enter my password on-screen.
But how do I keep these private key prompts from going to the screen in the future? I'm fine with being prompted for my passphrase, but I would like it to happen in a terminal window in the future.
Best Answer
the password for your key is managed by
ssh-agent
and it defaults to ask for your password using the GUI you mentioned. You could:ssh-agent
by callingssh-add
. In this case you might want to lock your key withssh-add -D
before you log out of the box.Circumvent
ssh-agent
by temporarily unsetting theSSH_AUTH_SOCK
variablessh
uses to connect to the agent. You can do this for a single command like thisor for the whole shell session by calling
unset SSH_AUTH_SOCK
.Marcel