Using passwords to log in to remote Linux servers has proven to be insecure and prone to brute force attacks. In this blog, I’d like to show you how to create your own key pair and test.
~ ❤ ssh-keygen -t rsa -b 4096 -C "corvo@X1C"
Please copy the file which has the pub postfix, like
And you need to make sure that the content in the public key will insert into a file in the target server, and the exact user your want to login with. For example, if you want to login with
xxx, the file should be:
I’d like to use ssh and just copy the content to the target file. The file should be like this:
root@xxx ~/.ssh$ cat authorized_keys
- You can use
-ito specify the private key path.
~ ❤ ssh firstname.lastname@example.org -i ~/.ssh/id_rsa_test
If you encounter some problems, I’d like to recommend you to use the
ssh -vvvto print the debug log. Here is an example:
~ ❤ ssh email@example.com -i ~/.ssh/id_rsa_test -vvv