3

I'm writing Python app which uses pysvn to get svn log history. It works ok for http:// like urls, but for svn+ssh:// I get prompted for a password on the command line!

I use callback_get_login to authenticate.

Is there any way to avoid the prompt and authenticate with pysvn for svn+ssh svn repos?

AlG
  • 14,697
  • 4
  • 41
  • 54
umpirsky
  • 9,902
  • 13
  • 71
  • 96
  • Have you tried [`pysvn.Client.set_auth_cache`](http://pysvn.tigris.org/docs/pysvn_prog_ref.html#pysvn_client_set_auth_cache)? – jcollado Dec 22 '11 at 12:45
  • @jcollado Tried now, it prompts anyway. Maybe if I enter password once it will not prompt again, but I'm building a PyGTK app and I want to have complete control over credentials, no additional prompts for password. Thanks for the hint. – umpirsky Dec 22 '11 at 12:50
  • The most effective trick to avoid being asked for a password is using public key authentication and make sure that the key is created without any password. If the user decides to work with passwords, I don't think is your application responsibility to workaround this, just to ask for the password in the nicer way. – jcollado Dec 22 '11 at 14:23
  • @jcollado I don't get it why for http:// like urls callback_get_login works fine, and for ssh:// it prompts for password? I want my app to behave consistent in both cases. – umpirsky Dec 22 '11 at 15:11
  • It's just a guess, but maybe that depends on the authentication method. Have you tried to set `PreferredAuthentications` in your `~.ssh/config` file? – jcollado Dec 22 '11 at 16:26
  • I think you are right, shh auth is not supported by pysvn, so app will only do svn auth part, leaving ssh auth up to user to manage it with public key. – umpirsky Dec 22 '11 at 16:34

1 Answers1

1

This is the normal behavior for svn+ssh. Unless you have SSH Keys deployed and are connecting using the username for that host, you are going to have this issue.

Unfortunately, after some research it looks like PySVN may not support the use of SSH keys at this moment in time.

Drahkar
  • 1,694
  • 13
  • 17
  • Yes, I come up to same conclusion, thanks. App will only do svn auth part, leaving ssh auth up to user to manage it with public key. – umpirsky Dec 22 '11 at 16:34