SSH login without password

SSH Login without Password
To login in SSH without password, we need to do the following:

1. Generate a key pair (private key and public key) in Server A  ssh-keygen -t rsa

2. Copy the public key from Server A to Server B.  scp id_rsa.pub username:[server_B_ip_address]:/home/username/.ssh

3. In Server B, add that public key into authorized_keys file. cat id_rsa.pub >> authorized_keys

4. Verify it from Server A.  ssh username@[server_B_ip_address]