Enable Password less authentication between two machines.
ssh-keygen
is a command-line tool used to generate and manage SSH keys for secure communication between computers over a network. SSH (Secure Shell) is a network protocol used for secure remote access to servers and other network devices.
The ssh-keygen
tool generates a pair of keys: a public key and a private key. The public key can be shared with remote servers, while the private key is kept on your local computer for authentication purposes.
To generate a new SSH key pair with ssh-keygen
, you can run the command in a terminal window:
ssh-keygen -t rsa -b 4096
This command generates an RSA key pair with a key length of 4096 bits. The tool will prompt you to specify a file location and passphrase for your private key. You can also accept the default options by pressing Enter for each prompt.
Once you have generated your key pair, you can copy the public key to remote servers that you wish to connect to using SSH. This can typically be done by copying the contents of your public key file (usually located at ~/.ssh/id_rsa.pub
) and pasting it into the authorized_keys
file on the remote server.