Under Linux, git cannot be used, prompt sign_and_send_pubkey: signing failed: agent refused operation

Under Linux, Git cannot be used if the server has already added a public key
Git Clone and other functions cannot be used under Linux. Prompt:

sign_and_send_pubkey: signing failed: agent refused operation

In turn (if no public key is added) :

ssh-add
eval $(ssh-agent -s)

Execute (public key has been added) :

eval $(ssh-agent -s)

Eval $(sSH-Agent-s) system runs at startup
Obviously, the above method requires executing eval $(sSH-agent-s) before using Git for the first time. Otherwise, it is not friendly to use an error. We want to avoid the trouble of eval $(ssh-agent-s) once and for all, which is unlikely to be remembered. Therefore, I need to initialize this command when the system boot, help me to execute this command.
Current user (if you prefer “any configuration is for users”)
modify ~/.bashrc, vim ~/.bashrc
add this line (suggested at the end) :

# 启动 ssh-agent,“> .null”是为了解决在终端喊一嗓子的问题(其实就是将它输出到一个.null文件中去了)
eval $(ssh-agent) > .null

All users (recommended)
modify (may need sudo, add it yourself as necessary) /etc/bashrc, vim /etc/bashrc
add this line (it is recommended to add it at the end) :

# 启动 ssh-agent,“> .null”是为了解决在终端喊一嗓子的问题(其实就是将它输出到一个.null文件中去了)
eval $(ssh-agent) > .null

Read More: