Use SSH-keygen to remotely log on to the host without a password

Source: Internet
Author: User

SSH use ssh-keygen to remotely log on to the host without entering the password environment: local host name: ha01eth0: 192.168.1.100 // external IP address www.2cto.com remote host name: ha02eth0: 192.168.1.200 // external IP address local host ha01 Configuration: [root @ ha01/] # cd/etc/ssh [root @ ha01 ssh] # ssh-keygen-t rsa-N "" (This step generates a key public/private key pair, -N "" indicates that the key pair phrase is empty.) Generating public/private rsa key pair. enter file in which to save the key (/root /. ssh/id_rsa): 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: 82: 2c: 74: 43: 8e: 16: f4: ef: ac: 91: 0f: d7: 6f: a6: f3: 59 root @ ha01 copy the public key to the remote host: www.2cto.com if the ha02 server/root /. the ssh/authorized_keys file does not exist [root @ ha01 ssh] # scp/root /. ssh/id_rsa.pub root@192.168.1.200:/root /. ssh/authorized_keys if the authorized_keys file exists in ha01, run: [root @ ha01 ssh] # scp/root /. ssh/id_rsa.pub root@192.168.1.200:/root /. run [root @ ha02/] # cat/root /. ssh/id_rsa.pub>/root /. ssh/authorized_keys SSH logon test: [root @ ha01 ssh] # ssh ha02Last login: Fri Apr 8 10:41:28 2011 from ha01

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.