# Ruby + git +ssh keys

**URL:** <https://www.ruby-forum.com/t/ruby-git-ssh-keys/183549>\
**Category:** Ruby\
**Created:** [February 16, 2010, 12:18pm UTC](https://www.ruby-forum.com/t/ruby-git-ssh-keys/183549 "2010-02-16T12:18:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spod](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8491ac/32.png) [@spod](https://www.ruby-forum.com/u/spod)\
**Post date:** [February 16, 2010, 12:18pm UTC](https://www.ruby-forum.com/t/ruby-git-ssh-keys/183549/1 "2010-02-16T12:18:44Z")

</div>

Problem: i need to verify git repo properties (ssh key,repo url) in ruby

Solutions:

1. write ssh key into ~/.ssh/id\_rsa file and execute “git clone” command  
with repo url property - easiest way  
-cause race conditions when multiple users trying to check theirs repos.
2. write key into any file and link server and key in ssh.config file  
than execute git in ordinal way  
-ssh.config file has limited lenght(255 records)
3. add key via ssh-agent and execute git in ordinal way  
-ruby can’t handle passphrase request (if ssh key protected with  
passphrase)

Resume: so i need universal solution (like ssh -i) that is easy to  
use,clean,will work in multithread environment and all errors can be  
handled via basic IO (exec and so on)
