Skip to content

Instantly share code, notes, and snippets.

View rubayethossain's full-sized avatar

Md. Rubayet Hossain rubayethossain

View GitHub Profile
@rubayethossain
rubayethossain / macos-ssh-key-forget-fix.txt
Last active May 4, 2020 15:05
Fix MacOS forgets added ssh-keys and have to ssh-add on every reboot
Taken from - https://github.com/lionheart/openradar-mirror/issues/15361#issuecomment-270242512
This solution may be a bit naive, but I was able to restore pre macOS Sierra ssh-agent behavior by creating a config file (~/.ssh/config) with the following contents:
Host *
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
Optionally replace ~/.ssh/id_rsa with the path to your key. To add additional keys, add a new line for each key with: IdentityFile /path/to/your_key.