If you are experiencing an issue where macOS keeps asking for the passphrase for your SSH key after an upgrade or reboot, there are a few steps you can try to fix the issue:
id_rsa
and id_rsa.pub
) are only readable by you. You can use the chmod
command to set the permissions of your SSH key files to 600. For example:chmod 600 ~/.ssh/id_rsa
~/.ssh
directory. Make sure that the ~/.ssh
directory is only readable and writable by you. You can use the chmod
command to set the permissions of the ~/.ssh
directory to 700. For example:chmod 700 ~/.ssh
authorized_keys
file. Make sure that the authorized_keys
file in the ~/.ssh
directory is only readable and writable by you. You can use the chmod
command to set the permissions of the authorized_keys
file to 600. For example:chmod 600 ~/.ssh/authorized_keys
Check the SSH configuration file. Make sure that the ~/.ssh/config
file does not contain any options that override the default behavior for handling SSH keys. For example, the IdentitiesOnly
option should not be set to yes
.
Add your SSH key to the ssh-agent. If you are using the ssh-agent to manage your SSH keys, you may need to add your SSH key to the ssh-agent after an upgrade or reboot. You can use the ssh-add
command to add your SSH key to the ssh-agent. For example:
ssh-add ~/.ssh/id_rsa
You may also need to start the ssh-agent if it is not running.