ssh No such file or directory

Viewed 25025

I had to wipe out my Windows OS. I went to check if I had ab ssh still and there was none so I created one.

Went through the proper steps and even got the agent ID.

Now when I try and find the id/rsa/pub using bash it tells me no file or directory.

But I can find that ssh file using my file explorer. Trying to get ssh keys to reload up to my GitHub and Heroku.
After searching stackoverflow I did find an article saying to run the command env|grep HOME and make sure HOMEDRIVE=C: was set to HOMEDRIVE=C:Users/Samson/ but mine is not.

If that is the correct fix how do i set HOMEDRIVE=C: = to Users/Samson/

I am on a Windows Machine

If that isn't the correct fix, I'm open to suggestions. I am extrememly green to this. enter image description here enter image description here

3 Answers

Problem

There are two problems in the attempt to display the ssh public key, shown in the screenshot:

  • No command is used, the file path is entered directly. The command cat may be used for this purpose.
  • The file path is incorrect: id_rsa/pub instead of id_rsa.pub.

Solution

In order to view the public key file content, try the following command in bash:

cat ~/.ssh/id_rsa.pub

Otherwise, you may simply open the file from windows explorer, using a text editor (e.g. notepad).

You have to generate key first Use this command to generate key
ssh-keygen -t rsa -b 4096 -C "youremail@example.com" Enter the above email which you have in you github. And now press enter and then you key will generate, and you will be able to acquire you ssh key This command -- ssh-keygen -t rsa -b 4096 -C "youremail@example.com"

I am on a Windows Machine

Its okay to be on a Windows machine, but you should run these commands from a Git Bash window and not a windows command prompt or an anaconda command prompt. That maybe your real problem.

Related