0

I tried to create a ssh key by doing following command:

ssh-keygen -t dsa

then it prompts me to enter store path:

Enter file in which to save the key (/Users/KesongXie/.ssh/id_dsa): id_dsa

after I entering my passphrase, i got the following result

Your identification has been saved in id_dsa.
Your public key has been saved in id_dsa.pub.

Then i tried to load my private ssh key using the followibg command

ssh-add /Users/KesongXie/.ssh/id_dsa

It shows the result:

-bash: ssh-add/Users/KesongXie/.ssh/id_dsa: No such file or directory

When I navigate to my local diretory, Users/KesongXie, and I can not find the .ssh file(as expected , doc files are hidden ), but when I tried to view it in my terminal, I type

cd ~
pwd

I got Users/KesongXie and i tired to ls and expect to see my .ssh, but it's still invisible. then i tried to

cd .ssh

I found out i then entered the .ssh directory, use ls , i can see the following result:

github_rsa  github_rsa.pub  id_dsa      id_dsa.pub  known_hosts

the keys do store in the .ssh folder , but i wonder why i can not load the private key using

ssh-add /Users/KesongXie/.ssh/id_dsa
1
  • Try to copy-and-paste the command you entered in your post into the terminal. It should work. You must have mistyped it into your terminal the first time.
    – BenjiWiebe
    Jul 12, 2014 at 17:01

1 Answer 1

1

-bash: ssh-add/Users/KesongXie/.ssh/id_dsa: No such file or directory is a strange error message - It means Bash thought you tried to run the literal command ssh-add/Users/KesongXie/.ssh/id_dsa. Are you sure you used an ASCII space (0x20) after ssh-add?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.