Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to use the DOS command line to enter the command: git clone "git_path.git" myDir It asks me to enter a password which I would like to avoid. I usually use TortoiseGit to do all git related operations. I would like to setup cruisecontrol using ant with a custom git task. Therefore I need to perform git clone on the command line in Windows 7. But it only works using git bash and not DOS.

According to other forum entries, I tried to convert the key with puttyGen and put the file id_rsa in c:/Users/myName/.ssh I also added an authorized_keys file but it still asks for a password. Any ideas?

Thanks

share|improve this question
    
Is the place you're cloning from also on a Windows server? –  nickgrim Mar 9 '11 at 21:41
    
no, it's on a linux server. –  Sandy Mar 11 '11 at 17:12
1  
There is no DOS subsystem anymore. You want to do this from the command prompt. –  MDMarra Sep 26 '12 at 12:04
    
can you do a password-less ssh comand on the server? and is the remote machine password or the ssh key password that u get asked? –  Aragorn Nov 28 '12 at 21:10

1 Answer 1

I'd guess that the problem is that git bash knows to look for a public-key in your home directory, but the DOS box doesn't.

There are, I think, a few options available to you (none of which I've tried, since I don't have a Windows box to hand):

  • Make sure that you're running pageant (I assume you're not, since you didn't say you were) and that you've got that private key loaded.
  • Set up a connection in PuTTY named after your remote-server and specifying the private-key in the settings.
  • Set the GIT_SSH environment-variable to something that specifies the location of the private-key - I'd guess the contents should probably be something like plink -i c:/Users/myName/.ssh.
share|improve this answer
    
Thanks, but it still doesn't work. I installed pageant, opened Putty, entered the remote address and added the private key to the session. But it still wants a username and password to login. Isn't the private key enough? I didn't really get what you meant with point 3: how does that work with plink? Thanks! –  Sandy Mar 14 '11 at 23:17
    
The third line is kind of the whole point of it. Nickgrim's instructions will have git using putty with pageant to handle its SSH connections, which can use the private key. –  Falcon Momot May 24 '13 at 9:31

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.