How do I verify/check/test/validate my SSH passphrase?

后端 未结 5 695
春和景丽
春和景丽 2020-12-12 08:47

I think I forgot the passphrase for my SSH key, but I have a hunch what it might be. How do I check if I\'m right?

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 09:20

    If your passphrase is to unlock your SSH key and you don't have ssh-agent, but do have sshd (the SSH daemon) installed on your machine, do:

    cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys;
    ssh localhost -i ~/.ssh/id_rsa
    

    Where ~/.ssh/id_rsa.pub is the public key, and ~/.ssh/id_rsa is the private key.

提交回复
热议问题