Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

git - Attempting to add my SSH key to the ssh-agent but getting 'no such file or directory.'

Below are my steps to create and attempt to add an SSH key but I'm rather unsure where I am going wrong, any help is greatly appreciated! (I'm new to this, sorry)

Following online instructions, I first generated a new shh-key using the following code:

$ ssh-keygen -t ed25519 -C "[my email]"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/Akiper/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in
Your public key has been saved in  .pub

etc.

I then made sure that the ssh-agent was running in the background and attempted to add my generated shh-key to the shh-agent but i got the following error:

$ eval `ssh-agent -s`
Agent pid 304

$ ssh-add ~/.ssh/id_ed25519
/c/Users/Akiper/.ssh/id_ed25519: No such file to directory

As you can see in the third line of code, the key was saved in the following file:

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

and as you can imagine, I am rather confused as to why the code says that it cannot find the key in such, or I may be interpreting the code wrong. Again, any help and advice are appreciated.

Thank you.

question from:https://stackoverflow.com/questions/65852243/attempting-to-add-my-ssh-key-to-the-ssh-agent-but-getting-no-such-file-or-direc

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Make sure you dont have any premade ssh keys in ~/.ssh/ directory then try this out ssh-keygen -t rsa -b 4096 -C "email" follow the next steps as usual ed25519 is 2048bits for rsa key whereas the above one is 4096 bits .


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...