Currently, SSH key authentication is usually configured for services like GitHub.
Therefore, it is necessary to use SSH-agent to manage the private key.
In Gentoo, the configuration is as follows:
-Sudo emerge-AVT keychain
-Edit. bashrc and add the keychain <private key 1 path>... <private key N path>
-Edit. bashrc. After the preceding sentence, add source $ home/. keychain/$ hostname-sh.
Tools similar to ssh-add require environment variables such as ssh_auto_sock to know the ssh-agent information. The keychain has been generated for us, so we need the above sentence source, refer to man keychain
Keychain is an SSH-Agent wrapper. Its function is as follows:
-Ensure that only one ssh-Agent process exists.
-Automatically generate settings for environment variables such as ssh_auth_sock.
For keychain, see here: http://www.ibm.com/developerworks/cn/linux/security/openssh/part2/index.html
This articleArticleDaniel Robbinson is the founder of Gentoo and author of keychain.