Method One:
1.ssh-keygen-t rsa-b 1024x768- TRepresentation Type- brepresents the key size (or, of course, it can be generated directly using Ssh-keygen) 2. Test @local-host$ ssh-copy-id-i ~/.ssh/id_rsa.pub remote-host (so that the key authentication of the transmission is also test users, please according to their own needs, to do the appropriate operation The default is saved to the corresponding user of the Remote-host .. In Ssh/authorized_keys)
3. ssh remote-host (or pay attention to the use of the user)
Repeat this operation on another server
Method Two:
ssh-keygen-t rsa-b The same procedure for creating a secret key
-
chmod-r ~/.ssh; Copy the public key to another machine , write to authorized_keys
-
< Span style= "color: #2c2c2c; font-family: ' The song Body '; > scp public key [email protected] another ip:root/
-
public key >>/root/.ssh/authorized_keys; chmod 600/root/.ssh/authorized_keys (operation in remote-host) Another server repeat this operation
A summary of Linux dual-machine SSH mutual trust method