Go to your home directory and edit .bash_profile
cd ~
vim .bash_profile
Add a line of code at the end
ssh-add /Users/xxx(这里修改成自己的电脑用户名)/.ssh/id_rsa
make the configuration take effect
source .bash_profile
Edit .ssh/config or /etc/ssh/ssh_config
Add the following code at the end:
Host *
ForwardAgent yes