To set up SSH keys on a Linux or Unix system, follow these steps:
ssh-keygen
command. For example:ssh-keygen -t rsa -b 4096 -C "your_email@example.com"Source:www.lautturi.com
This will generate a new RSA key pair with a 4096-bit key size. Replace your_email@example.com
with your email address. You will be prompted to specify a file to save the key pair in and to enter a passphrase.
ssh-copy-id
command. For example:ssh-copy-id user@remote-host
Replace user
with your username on the remote host and remote-host
with the hostname or IP address of the remote host. You will be prompted to enter your password on the remote host.
ssh user@remote-host
If the connection is successful, you should be logged in to the remote host without being prompted for a password.
For more information about setting up SSH keys, see the SSH documentation.