Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS , Error when generating an SSH key with Git: “no such file”

Tags:

git

macos

ssh

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.

like image 401
dengApro Avatar asked Jan 29 '23 00:01

dengApro


1 Answers

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:
like image 151
User123456 Avatar answered Feb 05 '23 15:02

User123456