Make macOS remember your SSH keys after restart

### We need to tell macOS to add the keys to the agent, in order to make them persistent after reboot.


We have to create new file in `~/.ssh/` called `config`
```bash
vi ~/.ssh/config
```

with the following content:

```bash
Host *
   AddKeysToAgent yes
   UseKeychain yes   
```

Then, we need to add our keys to the agent and macOS keychain (so your private key password is remembered).

```bash
ssh-add -D
ssh-add -K ~/.ssh/*
```

To verify that our keys are present in the agent: 
```bash
ssh-add -l
```

Zeno Popovici
11 Aug 2020
« Back to post