78.2 SSH Agent

20210914 Entering the passphrase every time you want to do a remote copy or make a remote connection can be tiring. There is a simple mechanism provided to avoid this. by starting up a shell that runs an agent or by informing the current shell to run an agent (ssh-agent) and inform the agent of the passphrase using ssh-add.

An example of starting up a shell with an agent:

ssh-agent bash

Or else simply start the agent within the current shell:

eval $(ssh-agent -s)

Then inform the agent of the passphrase just once:

$ ssh-add 
Need passphrase for .ssh/id_dsa
Enter passphrase for .ssh/id_dsa 
Identity added: .ssh/id_dsa (.ssh/id_dsa)

The ssh-add command takes an optional argument to name the file containing the private key.

ssh-add ~/.ssh/id_rsa_github

The -l option of ssh-add lists the key(s) currently kept in memory for this ssh-agent. The -d option removes an identity from memory, named by its file.

Your donation will support ongoing availability and give you access to the PDF version of the book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.