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

10,010

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:
Share:
10,010
dengApro
Author by

dengApro

我叫邓江洲, 准备面试中 Tech Engineer Get the magic 我的掘金: https://juejin.im/user/599fe9216fb9a0249d616ba8 我的 segmentFault: https://segmentfault.com/u/dengqingzhou

Updated on June 09, 2022

Comments

  • dengApro
    dengApro almost 2 years

    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.