When generating an SSH key with OpenBSD, we are asked to enter a file in which to save the key.
ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/TheUser/.ssh/id_rsa):
From reading the OpenBSD manual pages, I understand that the file we enter will store the private key and another file with a .pub
extension will store the public key.
Normally this program generates the key and asks for a file in which to store the private key. The public key is stored in a file with the same name but “.pub” appended.
The GitHub pages on Generating SSH Keys says that we should just press enter to continue here. My sense is that means we'll just use a default file, which I assume is in the parentheses, for example: (/c/Users/TheUser/.ssh/id_rsa)
.
Is what I wrote above correct? Also, what are the implications of actually entering a file in which to save the key rather than just pressing enter as GitHub suggests? While I'm pretty sure that id_rsa
is just the default, and that it can be anything, I would like to know the conventions.
when you enter a filename(for exsample: /e/myproject/.ssh/myssh
), the created SSH Key will be stored in /e/myproject/.ssh/
with name myssh
and myssh.pub
If you use a non default file name, you have to tell ssh to use this keyfile.
For example by adding to your .ssh/config
IdentityFile ~/.ssh/yourcustomfilename
or by using
# ssh -i ~/.ssh/yourcustomfilename
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With