1

I am trying to upload my first project at Github.com, for that i am following the steps:

During Setup Generating a new SSH key

  1. Opened Git Bash
  2. $ ssh-keygen -t rsa -b 4096 -C "myemail@example.com" (This command is working properly)

Output:

Generating public/private rsa key pair.

Enter file in which to save the key (/c/Users/abc/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /c/Users/abc/.ssh/id_rsa

Your public key has been saved in /c/Users/abc/.ssh/id_rsa.pub

The key fingerprint is:

SHA256:rJwyia2U0ENuNL0Gqf+NjXqqUa0Gdkffjdkfjdkjdkj myemail@example.com

The key's randomart image is:..................
..........................................


=============== ================= ===========================

Then i run the command..........

$ cat /c/Users/abc/.ssh/id_rsa.pub


cat: /c/Users/abc: No such file or directory

cat: abc/.ssh/id_rsa.pub: No such file or directory

Even i go to this path and check this file is available there.....

enter image description here

================= =================

Even if i run this command---

$ cat ~/.ssh/id_rsa.pub

it is showing the Key data of this file

============= =====================

I found one more command to solve this problem to save key in file---

$ ssh-keygen -t rsa -b 4096 -C "myemail@example.com" -f /path/to/key

Output:

Generating public/private rsa key pair.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Saving key "/path/to/key" failed: No such file or directory
Marc K
  • 253
  • 3
  • 8
  • 21
Tech World
  • 11
  • 2
  • 1
    Does this answer your question? [Where does GitHub for Windows keep its SSH key?](https://stackoverflow.com/questions/20226147/where-does-github-for-windows-keep-its-ssh-key) – Marc K Aug 13 '20 at 20:22

1 Answers1

0

You don't have to use bash to generate your key or to fetch its content.

You can open it with a regular notepad(++), copy its content, and paste it directly to your GitHub SSH keys setting profile page.

It will be in %USERPROFILE%\.ssh\id_rsa.pub

If you have not set a passphrase when generating the private key, all you need to do using the SSH URL for your push:

git push -u origin master git@github.com:<me>/<myrepo>
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283