5

I'm working with pysvn, and I'm trying to find a decent way to handle repositories that are only accessible via svn+ssh. Obviously SSH keys make this all incredibly easy, but I can't guarantee the end user will be using an SSH key. This also has to be able to run without user interaction, because it's going to be doing some svn log parsing.

The big issue is that, with svn+ssh an interactive prompt is popped up for authentication. Obviously I'd like to be able to have pysvn automatically login with a set of given credentials, but set_default_username and set_default_password aren't doing me any good in that respect. If I can't have that, I'd at least like to able to just fail out, and log a message to tell the user to setup an SSH key. However, set_interactive seems to have no bearing on this either, and I'm still prompted for a password with client.log('svn+ssh://path').

Any thoughts on how to tackle this issue? Is it even really possible to handle this without SSH keys, since it's SSH that's throwing the prompts?

f4nt
  • 2,661
  • 5
  • 31
  • 35

1 Answers1

2

Check out ssh configuration option PasswordAuthentication.

I'm not sure how pysvn interacts with ssh, but if you set this to no in your ~/.ssh/config (or maybe global config?) then it shouldn't prompt for a password.

bstpierre
  • 30,042
  • 15
  • 70
  • 103
  • I think that's about the best I can hope for probably. – f4nt Nov 21 '09 at 18:18
  • I set PasswordAuthentication to no in /etc/ssh/ssh_config and I'm still prompted for password when using pysvn. Any idea? – umpirsky Dec 21 '11 at 12:37
  • @umpirsky: Are you prompted for the *password* on the remote server or the *passphrase* for your key? – bstpierre Dec 21 '11 at 12:39
  • @bstpierre It prints "Password:" in console. Thx for quick response. – umpirsky Dec 21 '11 at 12:45
  • @umpirsky: set `LogLevel DEBUG2` and work your way through the debug messages. Also: it's probably worth opening a separate question, either here or on SU. You will likely find someone else who knows more about this than me. Feel free to leave a comment here with a pointer to the new question and I'll help if I can. – bstpierre Dec 21 '11 at 13:50
  • @bstpierre Thanks. I have added LogLevel DEBUG2 to my config, but messages are not visible when I run my app which uses pysvn? – umpirsky Dec 22 '11 at 11:31
  • Thanks anyway. Posted http://stackoverflow.com/questions/8603991/pysvn-prompts-for-password-with-svnssh – umpirsky Dec 22 '11 at 12:42