Configure macos ssh key forward

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

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325466608&siteId=291194637