Two linux servers use the RSA key pair SSH/SCP without a password.
Source: Internet
Author: User
Take the two linux servers rootA and rootB as examples to compile and install the latest openSSH version (recommended). the default setting of openSSH is to allow root users to directly log in. (PermitRootLoginyes). For the moment, we will consider how to use SSH to directly access the r...
Take the two linux servers rootA and rootB as examples to compile and install the latest openSSH version (recommended). the default setting of openSSH is to allow root users to directly log in. (PermitRootLogin yes). For the moment, we will first consider how to use SSH to directly log on from rootA to rootB without a password. let's take the root user as an example to describe how to use the root user to log on to rootA, you do not need a password to log on to the rootB server as the root user by using SSH. Perform the following operations: 1. log on to rootA and rootB as the root server and run ssh-keygen. the objective is to create a directory under/root--www.2cto.com. ssh: Press enter twice when passphase is prompted. This will generate/root/. ssh/identity and/root/. ssh/identity. pub, as shown in:
2. test it first. log on from rootA as the root and enter # ssh root @ rootB. a prompt of root password will be prompted. 3. now log on from rootA as root and run scp/root/. ssh/identity. pub root @ rootB:/root/. ssh/authorized_keys. The file name must be correct. 4. run it again from rootA # ssh rootB does not need a password :) 5. in contrast. /root /. in the ssh/directory and renamed it authorized_keys, then rootB # ssh rootB does not need a password. Author wkm
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.