Preparation: 2 machines, IP: 192.168.0.195 192.168.1.210
Purpose: Remote access via 195SSH 210. No Password required
1, first generate a key pair on 195.
#cd/root/.ssh
#ssh-keygen-t RSA
Generating public/private RSA key pair.
Enter file in which to save the key (/ROOT/.SSH/ID_RSA): (Direct carriage return)
Enter passphrase (empty for No passphrase): (direct carriage return)
Enter same passphrase again: (Direct carriage return)
Your identification has been saved In/root/.ssh/id_rsa.
Your public key has been saved in/root/.ssh/id_rsa.pub.
The key fingerprint is:
06:96:6b:56:0c:33:a4:24:16:8c:06:35:9b:98:8b:e7 [email protected]
2. Generate key pair Id_rsa and id_rsa.pub in Root/.ssh directory
Where Id_rsa is the private key, Id_rsa.pub is the public key.
3. Copy the public key directly to the 210/root/.ssh directory
#scp id_rsa.pub [email protected]:/root/.ssh
4. Rename the Id_rsa.pub on 210 machine to Authorized_keys
#cd/root/.ssh
#mv id_rsa.pub Authorized_keys
5. The key setting is successful. 195SSH Access 210 without password success
#ssh 192.168.1.210
It worked.
Linux problem Rollup---How to generate a key pair