One is 192.168.10.131 and the other is 192.168.10.135, now to achieve two requirements:
One, is 131 password-free login 135, and SCP rsync password-free copy
Second, is using the SECURECRT tool to log in 135, can only use the secret key to login, can not use the password login
The experimental steps are as follows:
1. run Ssh-keygen on 131 to generate a key pair where the public key is used for encryption and the private key is used to decrypt
2,ssh-copy-id-i/root/.ssh/id_rsa.pub [email protected], the generated public key content is copied to 135/root/.ssh/authorized_keys file, With Ssh-copy-id, this command automatically copies the contents of the public key into the Authorized_keys file and sets the permissions to 600. If you do not have this command install openssh-clients
You can then SSH directly to 135 on 131, and SCP rsync does not need to enter a password copy
Two
1. Copy the private key through SZ on 131
2. Modify the sshd configuration file on 135
Vim/etc/ssh/sshd_config
Pubkeyauthentication Yes #启用公钥认证
Authorizedkeysfile. Ssh/authorized_keys #公钥认证路径
Passwordauthentication No #设置不允许密码登陆
Restart sshd service /etc/init.d/sshd Restart
And then in the SECURECRT.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/71/wKioL1XQpAOgRMhHAAEghqafxiA883.jpg "title=" 1.png " alt= "Wkiol1xqpaogrmhhaaeghqafxia883.jpg"/>
Click Properties to locate the private key file that you just downloaded
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/75/wKiom1XQoiGwmde7AAFESpC-Cyg240.jpg "title=" 2.png " alt= "Wkiom1xqoigwmde7aafespc-cyg240.jpg"/>
Then you can log in by secret key, then you can't log in by password
This article is from the "PC personal blog" blog, make sure to keep this source http://pc1990.blog.51cto.com/10541224/1685101
Two Linux systems password-free login