I used a command to generate a key under my Mac, ssh-keygen
and I set a password for the key on my own, so that I had to enter the password once every time I came in git push
:
for /Users/zhaohd/.ssh/id_rsa:
With too much trouble, I want to get rid of it, go online check, found that Ssh-keygen itself realized this function. Here's how to use it:
1, enter under the terminalssh-keygen -p
(/Users/username/.ssh/id_rsa):
2, the system will be prompted to select the private key to be modified, you can directly enter, the default is/Users/username/.ssh/id_rsa
3. Select the file and press ENTER, you will be prompted to enter the old password:
Enter old passphrase:
4. Prompt for a new password when you are ready to enter:
(empty for no passphrase):
5. If you enter directly, you will be prompted to confirm the new password, and then enter directly, at this time the private key password previously set is cleared:
Enter same passphrase again:
Mac Clear/Modify SSH private key password