Reputation: 4008
I want to work with GitHub and multiple accounts. I am following this tutorial, I need to generate a unique SSH key for our second GitHub account and meet a problem:
Saving key "~/.ssh/id_rsa_nettuts" failed: No such file or directory
There is a a very similar answer, while the answers are all windows and do not work.
The code is as following:
$ ls
id_rsa id_rsa.pub id_rsa_nettuts known_hosts
$ ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/hou/.ssh/id_rsa): ~/.ssh/id_rsa_nettuts
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Saving key "~/.ssh/id_rsa_nettuts" failed: No such file or directory
$
Many Thanks in advance.
Upvotes: 6
Views: 19422
Reputation: 1073
adding just pointer to what @User123456 said, it doesn't matter where you run the cmd as long you give the full path & file name to save your key
/Users/username/.ssh/id_rsa_netus
Upvotes: 0
Reputation: 11
I know that this is an old question but today I had this problem and if anyone else is facing ssh issues below are the steps that worked for me I have a mac:
2.Enter file in which to save the key (/home/user/.ssh/id_rsa):
I just accepted the recommended path pressing enter
3.After assigning a file to save your SSH key, you'll get a chance to set up a passphrase for your SSH key: Enter passphrase (empty for no passphrase): Enter same passphrase again: If successful, you'll see confirmation of where the ssh-keygen command saved your identification and private key.
4.Open your browser and paste the url directory ex. file:///home/user/.ssh/id_rsa.pub And you will see a json format of ssh key ending up with your email
5.Add into your git ssh key settings
Upvotes: -1
Reputation: 59
I agree with BRjava's solution. In addition to his answer, I say check your file directory to see if a ".ssh" file exists. (Caveat: Do not try to create one because windows explorer won't let you anyway).
If the file does not exist, simply carry out these
Steps:
ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hp/.ssh/id_rsa): "Press Enter on your Keyboard" (note: The directory will be created) Enter passphrase (empty for no passphrase): Enter same passphrase again:
(The below steps are not needed if you only intend getting past enter "passphrase" stage)
Then proceed to your Git repo
Upvotes: 0
Reputation: 2738
hope you are inside .ssh dir . When you are entering key name , just enter the file name instead of path. EX:
ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hp/.ssh/id_rsa): id_rsa_netus
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Upvotes: 10