Ssh-agent usage
Ssh-agent
I have never known what an ssh-agent is. I read several articles tonight and finally learned about it.
Generally, ssh-keygen generates a public key private key during ssh. Note that you can select a password or no password when generating the private key. Openssh allows you to use keys instead of passwords. Then, do password-free login, usually copy to. ssh/authorized_keys, or use ssh-copy-id. In fact, after Step 2 is completed, the password will basically not be logged in. What is the use of ssh-agent and ssh-add?
In fact, when using ssh-keygen, you can either enter a password or do not enter a password. That is just the case where you did not enter the password. If you lose the password, during ssh Login, you will still be prompted to enter the password of the private key (you do not need to enter the server password ). The ssh-agent can avoid such troubles when repeatedly inputting the private key.
Easy to use
Ssh-agentssh-add private key (here we will prompt you to enter the password once, save the password in the cache, and then you will not be able to input it again) There is a key chain Access on the mac, it is a password-management software, and also implements ssh password-free login through ssh-add.