pem file server via ssh landing

Some for safe operation, it is recommended to use the private key to sign the server, take jenkins, the default authentication method is private

Method to realize

First by the native ssh-keygen generates a public and private key directly
Generated as follows in the current folder my.pem (private key) and my.pem.pub (public)
ssh-keygen -t rsa -f my.pem -C "[email protected]"
Parameters: -t of the type key type (rsa, dsa ...), -f generates a file name, -C Remarks
 The resulting file
The my.pem.pub content uploaded to the server you want to connect
Procedure, edit authorized_keys file, the current path in the user directory .ssh folder
The content generated pub appended to the file authorized_keys file
After save and exit will be through ssh -i file user @ ip visit
Connection the following command
xshell tools such as direct elections connection using the private key on it
The following tools are connecting
 ok!
 

Guess you like

Origin www.cnblogs.com/chywx/p/11147172.html