Quickly and easily generate a key pair for passwordless connection. Also works perfect as git deploy keys!
Generate the keys
DO NOT DO THIS AS ROOT
Run the command to generate the keys
|
|
-b
flag sets the bits, 4096 is recommended-m pem
is needed to generate a file in RSA Private Key format, not in OpenSSH Private Key format-f
specifies the output key pair- replace
my-key-pair
with the name of your key pair (preferablydeploy_key
oraccess_key
)
This will generate two files:
my-key-pair
- this is your PEM file, copy paste the contentsmy-key-pair.pub
- this is the corresponding public key file
Note: You may want to rename the my-key-pair
to my-key-pair.pem
for convenience.
Set the key to allow login
In order to be able to log in using the generated PEM file, you should add the public key to the authorized_keys list. To do that, run
|
|
Read Next
I’m running an experiment for better content recommendations. These are the 3 posts that are most likely to be interesting for you:
-
Using different Github accounts with different private keys on Linux
After mastering the art of creating a secure 4096-bit RSA key, learning how to juggle multiple GitHub accounts with ease could be your next savvy move in streamlining your development workflow. -
The Ultimate Interactive JQ Guide
Unlock the power of JSON manipulation with jq, enhancing your SSH key management and deployment strategies by diving into real-world data handling scenarios.
Recommended reading not found for slug or filename: 'post/power-digits-log-formula-trick'