Linux Remote Login ssh password-free

Source: Internet
Author: User

Linux Remote Login ssh password-free
I. Scene company has just a few Linux instances. Now we need to remotely log on to hosts using ssh without a password. II. The principle is very simple. Use ssh-keygen to generate private and public keys on host A, and copy the generated public keys to remote host B, you can use the ssh command to log on to host B on another machine without a password. 3. Step host A: 1. Generate the public key and Private Key Files id_rsa and id_rsa.pub (press Enter 3) [root @ bogon ~] # Ssh-keygen-t rsaGenerating public/private rsa key pair. enter file in which to save the key (/root /. ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in/root /. ssh/id_rsa.Your public key has been saved in/root /. ssh/id_rsa.pub.The key fingerprint is: 67: da: 0d: 79: e0: d6: 2b: cd: 7d: 22: af: 51: 7e: 9c: 75: fe root @ bogonThe key's randomart Image is: + -- [RSA 2048] ---- + |. |. + | s B o. o | ** = o + |. o B +. = |. ++. |... E | + --------------- + 2. The ssh-cop-id command will copy the specified public key file to the remote computer [root @ bogon ~] # Ssh-copy-id-I ~ /. Ssh/id_rsa.pub [email protected] The authenticity of host' 10. 1.250.166 (10.1.250.166) 'Can't be established. RSA key fingerprint is c8: 9d: 6d: 92: 55: 77: 3d: 3e: af: f5: cb: 18: 80: 5a: 47: 93.Are you sure you want to continue connecting (yes/no )? YesWarning: Permanently added '10. 1.250.166 '(RSA) to the list of known hosts. reverse mapping checking getaddrinfo for bogon [10.1.250.166] failed-possible break-in attempt! [Email protected]'s password:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.