logo
logo
Sign in

How to add our SSH key to ssh-agent (SSH authentication agent)?

avatar
CD Cloud Logix
How to add our SSH key to ssh-agent (SSH authentication agent)?

The SSH(Secure Shell) is a cryptographic network protocol for operating network services securely over an unsecured network.


And, ssh-agent is a key manager for SSH.



Steps:

First, start the ssh-agent in the background.

eval "$(ssh-agent -s)" 

Add the SSH private key to the ssh-agent.

ssh-add ~/.ssh/id_rsa 

To check ssh key added into ssh-agent

ssh-add -L 



Steps for MAC

If you’re on a Mac, you can store your ssh keys in your keychain then load them all at once after a reboot:

ssh-add -K ~/.ssh/id_rsa 

Then the next time you log on, just run:

ssh-add -A 


Using gpg-agent instead of the stock ssh-add on Linux can make your keys persistent across reboots.


Learn how to migrate your infrastructure into the future world đź”˝

CD Help right NOWDevops

collect
0
avatar
CD Cloud Logix
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more