Assume thatSuppose you have several remote Linux machines to manage and.
First, you setup ssh login by creating a public private-private key pair issuingusing ssh-keygen -t rsa on your local machine. AssumeLet's also suppose that you didntdon't set a passphrase whilewhen creating your keys. Now
Next, you will copy your public key to all the remote machines where you wantyou'd like to login to by issuingrunning ssh-copy-id -i ~/.ssh/id_rsa.pub user@somehost. Now, with your keysprivate key, you will be able to login to all the machines where you copied your keyspublic key.
Since you didntdidn't create a passphrase, anyone who getswith your private key can login to all the machines where your public key ishas been added. AssumeSuppose you letgive access to your local machine to be used by some of your friends and one of himthem is evil-minded. To prevent thisthem from doing something malicious on the remote machines, you set a passphrase tofor your private key. SoNow, whenever you login using your key, you will be prompted for the passphrase and so only you (who knows the passphrase) can login.
But it becomes cumbersome to type the passphrase whenever you want to login to other machines. So you can give your passphrase to ssh-agent once and it will use it whenever required. You use ssh-add to give your keys to ssh-agent. You can always check what all keys your ssh-agent is managing by issuing ssh-add -l.