SSH keys provide a more secure way of logging into a virtual private server with SSH than using a password alone. SSH keys are nearly impossible to decipher.
- Create the key pair on the client machine
ssh-keygen -t rsa
Once you have entered the command, you will get a few more questions. Answer them all.
- Copy the Public Key
Once the key pair is generated, it’s time to place the public key on the remote server that we want to use.ssh-copy-id user@remote-server