How to link ssh key to ssh agent and push files to github account

Viewed 139

I need help on how to link my ssh key to ssh agent.

On generating the key which was saved at (mykeys) which i can view, the codes belows where generated in the bash terminal window.

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/user/.ssh/id_rsa): mykeys
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in mykeys
Your public key has been saved in mykeys.pub
The key fingerprint is:
SHA256:/DEK8rKIlb+j1aEVWL3jYG5I0dcuYk4DoKuxrHiGOws user@OshimiriAtata1

The error I keep getting for all my trials is:

No such file or directory

I have followed the instructions I get on various YouTube videos I am watching currently, but cannot figure out what the issue is.

I have tried the following:

ssh-add \~/.ssh/id_1895
ssh-add ..ssh/id_1895`your text`
ssh-add .ssh\\id_1895
ssh-add \~/.ssh/id_rsa`your text`
ssh-add \~/.Henry/.Data-set/.ssh_mykeys

All to no avail.
Please can you help me?

1 Answers

Following "Generating a new SSH key and adding it to the ssh-agent", the command would be:

sh-add C:\path\to\mykeys

And you would need a ~/.ssh/config file with

Host gh
  Hostname github.com
  User git
  IdentityFile C:\path\to\mykeys

Test if this works with: ssh -Tv gh, you should see a welcome message similar to:

Hi *****! 
You've successfully authenticated, but GitHub does not provide shell access.

You can use the URL with commands like:

git clone gh:myGitHubUser/myRepository
Related