ssh-copy-id

ssh-copy-id installs an SSH key on a server as an authorized key. It provides access without requiring a password for server login. This facilitates automated, passwordless login using the SSH protocol.
Step 1
Generate an SSH Key
Type the below command in client-server. Which will create a key pair (public key and private key). The key files are usually stored in the ~/.ssh directory.
# ssh-keygen
Step 2
Copy the key to a server

Use the command below to copy SSH public key to the remote Server.

# ssh-copy-id  [email protected]

Now we will be able to log in without password afterwards using the command below.

# ssh  [email protected]