Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I recently started using Git with GitHub and thus discovered that I already have a generated pair of SSH keys, public and private. This leads me to ask: what applications/programs/daemons on my Mac might have caused this keypair to be created? I've never used SSH to log in to another machine.

share|improve this question
add comment

4 Answers

up vote 0 down vote accepted

To be honest the question is a little bit huge. Your ssh keys could have been generated if you activated the sshd (Remote Login) from the sharing preference pane; as to what could have used (or uses them), it’s any program (like Git, Subversion, SFTP, etc) that requires ssh access. Not sure exactly which one could have generated for you, but you can always remove them and see what fails (save a backup!).

share|improve this answer
    
Remote Login is off (I just checked). I've never used an SSH/SFTP client, and before Git a few days ago, never used a VCS over the network. Thanks for having a go at the question, though. I'd mod you up if I had the rep! –  Yawar Sep 6 '10 at 19:06
    
Anytime, sorry I can’t really give you more info. Maybe you activated Remote Login once and then disabled it? The keys would still be there. –  Martín Marconcini Sep 6 '10 at 23:08
1  
Visitors: Please note this answer is not correct. Enabling Remote Login / SSH daemons will generate server side SSH keys, but those are located in /etc/ssh, not ~/.ssh/ like the op indicates. –  Jason Salaz Jan 6 '12 at 21:17
    
-1 for misinformation (as @JasonSalaz stated). Should be edited or possibly removed. –  Blacklight Shining Oct 10 '12 at 7:31
add comment

Amusingly, your own question includes the answer. GitHub for Mac uses Git via SSH, and will automatically generate unprotected SSH key pairs (e.g. no passphrase) in order to push/pull contents between the remote repo and your local ones.

share|improve this answer
add comment

The program to create SSH key pairs is ssh-keygen.

Enabling the SSH daemon in the Sharing preference pane does not create a key pair for a user in ~/.ssh/ The SSH daemon only creates a SSH host key pair in /etc/ssh_host*_key*

If you haven't used ssh-keygen to create the keys, maybe some other program did it for you. I don't know which one does that but I haven't used git.

As for using the keys, every program that uses SSH can use the keys. Some, like ssh, use the keys automatically, in some, like Cyberduck (SFTP), you have to select the key file manually.

share|improve this answer
add comment

Break out

fs_usage(1)

or

opensnoop(1m)

Both of these commands have options to watch a directory, or a path. Open a terminal and , well, watch ~/.ssh . See who actually accesses that path. If you find a program that is accessing that path illicitly, then tell us all. Please.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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