In some operation and maintenance scenarios, in order to avoid security risks such as brute force cracking of passwords, ssh keys are used to log in. For example, AWS EC2 and the open source springboard machine Jumpserver all use ssh keys to log in. |
Taking Jumpserver as an example, when the administrator creates a new user, the user's ssh key file (pem format) and ssh key password will be sent to the new user by email at the same time.
Then the next login steps are as follows:
step one:
Since the ssh key files imported by Putty, x Shell and other tools are in ppk format (namely: Putty Private Key), you need to download the PuttyGen tool first to convert the pem file to ppk format:
Open PuttyGen, click "Conversions > Import key" to select the obtained pem file, if the key file has a password set, the following prompt box will pop up, then enter the key file password:
Then click "Save private key" to generate and download the corresponding ppk format file:
Step two:
Open Putty, enter or Load the host information to be logged in, and then select "Connection > SSH > Auth" on the left
Then click "Browse" to select the ssh key file in ppk format, and then click the Open button to establish a connection with the ssh key:
Step three:
If the ssh key file has a password, then the Putty interface will prompt Passphrase for key “imported-openssh-key”: Enter the ssh key file password: