How to fix: MacOS keep asking passphrase for ssh key after upgrade or reboots

http‮‬s://www.lautturi.com
How to fix: MacOS keep asking passphrase for ssh key after upgrade or reboots

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:

  1. Check the permissions of your SSH key files. Make sure that your SSH key files (e.g., 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
  1. Check the permissions of the ~/.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
  1. Check the permissions of the 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
  1. 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.

  2. 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.

Created Time:2017-10-28 21:39:03  Author:lautturi