When the local client SSH to the remote server, each time you enter a user name and password, if you do not want to enter the password every time you can use the following actions.
First, the local client input Ssh-keygen
[Email protected] ~]$Ssh-keygenGenerating Public/private RSA key pair. Enterfile inch whichTo save the key (/home/keysystem/.SSH/id_rsa): Created directory'/home/keysystem/.ssh'. Enter Passphrase (Empty forno passphrase): Enter same passphrase Again:your identification has been savedinch/home/keysystem/.SSH/Id_rsa. Your public key has been savedinch/home/keysystem/.SSH/id_rsa.pub.The Key fingerprint is:af:a4:d5:4d: the: 3c: -: in: EA:Panax Notoginseng: -: 0c:Wuyi: 3b:ba:2b [email protected]the key's Randomart image is:+--[RSA2048]----+| . +o. || + O. || O. = || . + + . || S. X. || o = = | | o o O | | + . E. || . . .. |+-----------------+[[Email protected]~]$
To generate a public private key pair, you can enter into the ~/.SSH directory to view the generated public private key pair.
[Email protected] ~]$ CD ~/. ssh/[[email protected]. SSH] $ ll-81 keysystem keysystem 413 Dec 4:12 id_rsa.pub11675 Dec 4: id_ Rsa[[email protected]. SSH
Then execute ssh-copy-id [email protected], where Dzy is the user name of the remote host and 172.20.16.42 the IP address of the remote server.
ssh-copy-ID [email protected]172.20. 14.42
SSH login on linux remote server password free