mac:ssh登陸總是需要輸入鑰匙串密碼解決


 

 

方法1: 

物理重置法:

finder —> 左上角:前往—>按住option建—>多出一個資源—>KeyChains—>第一個文件夾(刪除掉次文件夾)

然后重啟即可

 方法2(此種方法更有效):

將~/.ssh/id_rsa添加至鑰匙串的管理

ssh-add -K id_rsa

或者

ssh-add -K ~/.ssh/id_rsa 

     ssh-add adds private key identities to the authentication agent, ssh-agent(1).  When run without arguments, it adds the files
     ~/.ssh/id_rsa, ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and ~/.ssh/identity.  After loading a private key, ssh-add will try to
     load corresponding certificate information from the filename obtained by appending -cert.pub to the name of the private key file.  Alterna-
     tive file names can be given on the command line.
 
     If any file requires a passphrase, ssh-add asks for the passphrase from the user.  The passphrase is read from the user's tty.  ssh-add
     retries the last passphrase if multiple identity files are given.
 
     The authentication agent must be running and the SSH_AUTH_SOCK environment variable must contain the name of its socket for ssh-add to
     work.
     -K      When adding identities, each passphrase will also be stored in the user's keychain.  When removing identities with -d, each
             passphrase will be removed from it.

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM