17

I apologize in advance for the dumb question, but I'm trying to set up an SSH key for GitHub on my Macbook. I open up the terminal and go to the root directory (my username) and type "cd ~/.ssh" and it says "No such file or directory". However, when I input "ssh -v", it lists:

OpenSSH_5.9p1, OpenSSL 0.9.8x 10 May 2012
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
           [-I pkcs11] [-i identity_file]
           [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path]
           [-W host:port] [-w local_tun[:remote_tun]]
           [user@]hostname [command]

Which according to another website means I have it installed. Yet I can't find the directory anywhere...

So I have two questions: How do I fix this? And where is the .ssh directory supposed to be?

1
  • 2
    Slhck's answer is probably right on, I just wanted to point out that the root directory is not your user name, that is your home directory. The root directory is where you go if you type cd /, it is the equivalent of C: in Windows or clicking on your hard drive in Finder.
    – terdon
    Aug 22, 2013 at 12:41

1 Answer 1

24

If the .ssh directory does not exist, you can simply create it:

mkdir -p ~/.ssh

Here, ~ is your home folder and is the same as /Users/allison. It is not the same as the root directory, which is / and thus the root of the entire file system.

Note that you usually do not need to manually create the folder. If you have never generated any SSH keys, or you haven't used SSH yet, the folder does not need to exist. However, once you generate a key (with ssh-keygen), SSH will automatically create the folder for you.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .