By default, SSH will authenticate with a password, without any configuration of the system, and you can log on to the remote server using your account and password. You can also use a key-based authentication method to achieve the effect of password-free login (the following are the specific configuration steps: Two server IPs, 10.0.1.1 and 10.0.1.2 respectively):
(1), create key
#ssh-keygen-d//plus parameter d is to create a SSH2-based key pair
#Generating public/private RSA key pair.
#Enter file in which to save the key (/ROOT/.SSH/ID_RSA): [Carriage return]
#Created directory '/root/.ssh '.
#Enter passphrase (empty for no passphrase): [Carriage return]
#Enter same passphrase again: [Enter]
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:
01:90:08:9E:7D:42:69:01:96:52:D7:CA:9F:53:43:DF [email protected]
(2), publish a common key to another host on 10.0.1.2
Publish the id_dsa.pub to the server and rename it to Authorized_keys:
#scp/root/.ssh/id_rsa.pub [Email Protected]:/root/.ssh/authorized_keys
[email protected] ' s password: [Enter password]
(3), modify the permission owner (on the 192.168.1.2 host)
# chmod 644/root/.ssh/authorized_keys
Linux Host Trust