- Generate public key private key on current Linux
Ssh-keygen
The public key private key holds the path: ~/root/.ssh/
Id_rsa id_rsa.pub
- Login by remote host , enter directory ~/root/.ssh/
Whether the Authorized_keys file exists, and if the new Authorized_keys file does not exist
Copy the contents of the Id_rsa.pub file generated in the first step to the Authorized_keys
You can also use the command Ssh-copy-id [email protected]
- SSH remote If you do not want to enter the IP address every time to modify the/etc/hosts file
Add 192.168.1.1 CentOS to the first line of the Hosts file
Next time you need to link this server directly input SSH CentOS can
Note : The server account is the same as the current login user name to take effect. Otherwise you need to enter SSH [email protected]
- For frequent remote servers can be set
CD bin/
VIM ABC
Enter the following:
SSH 192.168.1.1
chmod +x ABC
The next time you enter the ABC command directly, you can remote to the CentOS server
Note: If the setting is based on the third step
The IP address can also be set to CentOS
Linux System Password-free login remote server