After adding the public key to the server, an error is reported
sign_and_send_pubkey: signing failed: agent refused operation
Solution.
eval
"$(ssh-agent -s)"
ssh-add
More:
linux shell eval
Syntax: eval cmdLine
eval scans the cmdLine twice. If the cmdLine is a normal command after the first scan, it is executed; if the cmdLine contains an indirect reference to a variable, the semantics of the indirect reference is guaranteed.
Examples are as follows.
set 11 22 33 44
If you want to output the last parameter, i.e. 44, you can use the following command.
echo $4
But if we don't know how many arguments there are, and we want to output the last argument, we may think of using $# to output the last argument.
If the command is used.
echo "\$$#"
The result is $4, not 44 as we would like, and there is a problem with indirect references to variables.
This is where the eval command can be used.
eval echo "\$$#"
The result is 44
ssh-add command details
Syntax
ssh-add [-cDdLlXx] [-t life] [file ...]
ssh-add -s pkcs11
ssh-add -e pkcs11
Parameter description
-D :Delete all keys from ssh-agent;
-d : delete the keys from ssh-agent;
-e : pkcs11 : delete the key provided by PKCS#11 shared library pkcs1;
-s : pkcs11 : add the keys provided by PKCS#11 shared library pkcs1;
-L : Show the public key in ssh-agent;
-l : show the key in the ssh-agent;
-t : life: set timeout for loaded keys, ssh-agent will automatically unload the keys after the timeout;
-X : unlock ssh-agent;
-x : unlock ssh-agent; -x : lock ssh-agent;
Example
Add a special key to the ssh-agent cache
ssh-add /home/chen/.ssh/id_rsa
Remove the key from the ssh-agent
ssh-add -d /home/chen/.ssh/id_rsa.pub
View the key in ssh-agent
ssh-add -l
Similar Posts:
- Redis: How to Use the command to delete keys in batches
- Summary of SSH error reporting and solution records
- Python TypeError: __init__() missing 1 required positional argument: ‘on_delete’
- NS2 Execute Error: invalid command name “Agent/LUV” [How to Solve]
- [Solved] Pycharm Error: TypeError: init() missing 1 required positional argument: ‘on_delete’
- Vim:function definition file not found
- [Solved] docker info Check Error: WARNING: No swap limit support
- Git SSH public key authentication failed with git on Azure DevOps
- [Solved] Shell Error: syntax error: invalid arithmetic operator (error token is “