Generated public rsa key on mac for use with git, but can't locate it?
Question
I'm on mac os X (new to it) and need to generate a public rsa key for use with git (think I got that right). I'm following the directions here:
http://help.beanstalkapp.com/faqs/git/generating-and-adding-ssh-keys-on-mac-os-x
and have generated the key named (id_rsa.pub) in my home directory, but I don't see it there when I do ls, or when I view through the file explorer gui. Is it like a hidden file or something? How can I see it? I need to email the public key to someone,
Thanks
Solution
By default it stores the key in the ~/.ssh
directory, which is hidden.
All directories that start with a period are hidden, but can be seen either by directly naming them or by specifying the .
, as in:
ls .*
So to get a copy, you can type cp ~/.ssh/id_rsa.pub ~/
and it'll appear in your home directory.
OTHER TIPS
you can directly copy the key to the clipboard by executing this command in your terminal
cat ~/.ssh/id_rsa.pub | pbcopy
The following command can be used to copy the public key in your clipboard.
pbcopy < ~/.ssh/id_rsa.pub