Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enter file in which to save the key

Tags:

ssh

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.

like image 976
Shaun Luttin Avatar asked Oct 31 '14 03:10

Shaun Luttin


2 Answers

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

like image 86
Liubaichuan Avatar answered Nov 07 '22 11:11

Liubaichuan


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
like image 43
arved Avatar answered Nov 07 '22 10:11

arved