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