Issue
I use keychain
to manage ssh-agent
, and I add it into my .zshrc
.
I have a ssh key with passphrase.
With the normal terminal, I can use ssh
without call a passphrase
.
But in tmux, it will ask me to input a passphrase for my ssh-key.
These are run in normal terminal.
➜ ~ echo $SSH_AGENT_PID; echo $SSH_AUTH_SOCK
14112
/var/folders/hh/mmb417c53xx84ykdycyqls100000gn/T//ssh-
lyHqTWPT02HF/agent.14111
If running ssh my.server.domin
, it can connect directly.
I run tmux
in the same terminal and then
➜ ~ echo $SSH_AGENT_PID; echo $SSH_AUTH_SOCK
14112
/var/folders/hh/mmb417c53xx84ykdycyqls100000gn/T//ssh-lyHqTWPT02HF/agent.14111
If running ssh my.server.domin
, it will ask me to input passphrase.
Solution
I find that I have a alias
with ssh. alias ssh=ssh-ident
.
If I unalias it, all things are correct.
Answered By - Vonfry Answer Checked By - David Goodson (WPSolving Volunteer)