Skip to main content

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.

Assume that you have several Linux machines to manage and you setup ssh login by creating a public private key pair issuing ssh-keygen -t rsa. Assume that you didnt set a passphrase while creating your keys. Now you will copy your public key to all the machines where you want to login by issuing ssh-copy-id -i ~/.ssh/id_rsa.pub user@somehost. Now, with your keys, you will be able to login to all the machines where you copied your keys.

Since you didnt create a passphrase, anyone who gets your private key can login to all the machines where your public key is added. Assume you let your machine to be used by some of your friends and one of him is evil-minded. To prevent this, you set a passphrase to your private key. So 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 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.

Suppose you have several remote Linux machines to manage.

First, you setup ssh login by creating a public-private key pair using ssh-keygen -t rsa on your local machine. Let's also suppose that you don't set a passphrase when creating your keys.

Next, you copy your public key to all the remote machines you'd like to login to by running ssh-copy-id -i ~/.ssh/id_rsa.pub user@somehost. Now, with your private key, you will be able to login to all the machines where you copied your public key.

Since you didn't create a passphrase, anyone with your private key can login to all the machines where your public key has been added. Suppose you give access to your local machine to some of your friends and one of them is evil-minded. To prevent them from doing something malicious on the remote machines, you set a passphrase for your private key. Now, 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.

Assume that you have several linuxLinux machines to manage and you setup ssh login by creating a public private key pair issuing ssh-keygen -t rsa. Assume that you didnt set a passphrase while creating your keys. Now you will copy your public key to all the machines where you want to login by issuing ssh-copy-id -i ~/.ssh/id_rsa.pub user@somehost. Now, with your keys, you will be able to login to all the machines where you copied your keys.

Since you didnt create a passphrase, anyone who gets your private key can login to all the machines where your public key is added. Assume you let your machine to be used by some of your friends and one of him is evil minded-minded. To prevent this, you set a passphrase to your private key. So whenever you login using your key, uyou 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 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.

Assume that you have several linux machines to manage and you setup ssh login by creating a public private key pair issuing ssh-keygen -t rsa. Assume that you didnt set a passphrase while creating your keys. Now you will copy your public key to all the machines where you want to login by issuing ssh-copy-id -i ~/.ssh/id_rsa.pub user@somehost. Now with your keys, you will be able to login to all the machines where you copied your keys.

Since you didnt create a passphrase, anyone who gets your private key can login to all the machines where your public key is added. Assume you let your machine to be used by some of your friends and one of him is evil minded. To prevent this, you set a passphrase to your private key. So whenever you login using your key, u 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 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

Assume that you have several Linux machines to manage and you setup ssh login by creating a public private key pair issuing ssh-keygen -t rsa. Assume that you didnt set a passphrase while creating your keys. Now you will copy your public key to all the machines where you want to login by issuing ssh-copy-id -i ~/.ssh/id_rsa.pub user@somehost. Now, with your keys, you will be able to login to all the machines where you copied your keys.

Since you didnt create a passphrase, anyone who gets your private key can login to all the machines where your public key is added. Assume you let your machine to be used by some of your friends and one of him is evil-minded. To prevent this, you set a passphrase to your private key. So 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 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.

Source Link
clement
  • 3.4k
  • 2
  • 21
  • 12

Assume that you have several linux machines to manage and you setup ssh login by creating a public private key pair issuing ssh-keygen -t rsa. Assume that you didnt set a passphrase while creating your keys. Now you will copy your public key to all the machines where you want to login by issuing ssh-copy-id -i ~/.ssh/id_rsa.pub user@somehost. Now with your keys, you will be able to login to all the machines where you copied your keys.

Since you didnt create a passphrase, anyone who gets your private key can login to all the machines where your public key is added. Assume you let your machine to be used by some of your friends and one of him is evil minded. To prevent this, you set a passphrase to your private key. So whenever you login using your key, u 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 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