SSH: ssh-agent ssh-add

发布时间 2023-03-24 11:36:04作者: ascertain

 

Start ssh-agent

 

 

 

-a bind_address

Bind the agent to the UNIX-domain socket bind_address

-k  Kill the current agent (given by the SSH_AGENT_PID environment variable)

-t life 

Specifies a maximum number of seconds that identities are kept in the agent. The value is in seconds, but can be suffixed by m for minutes, h for hours, d for days, and w for weeks. Without this option, the agent keeps the keys in its memory as long as it runs. This can be overridden when running the ssh-add command.

 

 

Adding SSH keys to the Agent

By default, the agent uses SSH keys stored in the .ssh directory under the user's home directory. The ssh-add command is used for adding identities to the agent. In the simplest form, just run if without argument to add the default files ~/.ssh/id_rsa ~/.ssh/id_dsa ~/.ssh/id_ecdsa ~/.ssh/id_ed25519 ~/.ssh/identity. Otherwise, give it the name of the private key file to add as an agrument.

ecdsa ( Elliptic Curve Digital Signature Algorithm) which uses keys derived from elliptic curve cryptography (ECC)

 

 

Verify 

ssh -v -p 22 -l git -T github.com -i ~/.ssh/infringe

 

SSH Agent Forwarding

ssh command line 

 

ssh_config

 

 sshd_config

 

 

ssh -ATX -l git github.com

 

-o IdentitiesOnly=yes, ssh will only use that key and won't fall back to any other keys if it was rejected. ( Note that fallback to other machanisms, such as GSSAPI or password, is controlled by a different option)

-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no