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