Manage SSH keys between a Linux client and Server
Published on
#sys-admin
#linux
How to Create a New Ssh Key Pair
First, ensure the ssh agent is running:
Then, run command
and follow the on-screen prompts. It should generate your key inside the ~/.ssh/
directory.
A password may or may not be chosen to access the key pair. Using a password is of course more secure, but is in no way necessary.
From my experience, the ssh agent should automatically add the newly generated key to its store. But if doesn’t do it, you can simply use the following command to add the key pair manually:
Copy Ssh Key Pair to Remote Server
One the key pair has been created, simply use the following command to copy it to the remote server:
The above command should ask for your password one last time.
You should now be able to connect to the remote server without using passwords, like so: