Password logon is not required for ssh in linux.

Source: Internet
Author: User
In linux, ssh does not require password logon. because some scripts need to upload files to remote machines, scp is more convenient, but it is troublesome to enter the password every time, especially in the script, so if you do not need a password, it is more convenient. Upload files from local machine to target machine, linux1 from local machine, target machine... in linux, ssh does not require password logon. because some scripts need to upload files to remote machines, scp is more convenient, but password comparison is required every time.
It is troublesome, especially in scripts, so it is more convenient if you don't need a password. Upload files from the local machine to the target machine. the local machine = linux1, and the target machine = linux2. step: www.2cto.com linux1 operation: 1. generate a public key using ssh-keygen-t rsa. the default path is/root /. in ssh/, id_rsa.pub is the public key 2 and scp. ssh/id_rsa.pub root @ linux2:/root Upload The generated public key to linux2 3. ssh linux2 jump to linux2 linux2 operation: generate the authorized key mkdir ~ /. Ssh cat id_rsa.pub>. ssh/authorized_keys test ssh linux2 OK. PS: If you want to connect multiple machines to one machine, use incremental>. for example, upload id_rsa.pub under linux3 to the target machine cat id_rsa.pub>. ssh/authorized_keys OK. in this way, both machines can be connected to the target machine. The same applies to multiple instances.

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.