SSH login without password

From PCLinuxOSHelp Knowledge Base
Revision as of 15:39, 14 April 2018 by Dwmoar (talk | contribs) (Created page with "=== 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 '''''ss...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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]