disabling interactive password prompt with sshpeer

Thomas De Schampheleire patrickdepinguin at gmail.com
Mon Jan 26 14:34:31 CST 2015


Hi Matt, Eric,

On Fri, Jan 16, 2015 at 9:43 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Fri, 2015-01-16 at 21:38 +0100, Thomas De Schampheleire wrote:
>> Hi,
>>
>> I'm trying to add remote ssh repo support to Kallithea. When the
>> remote ssh repo is accessed using public keys, things work fine.
>>
>> However, when password authentication is used, the terminal that
>> started the kallithea server process is presented with a password
>> prompt, which obviously does not make sense in this case, as the user
>> of the web interface does not have access to that server process.
>>
>> I want to keep things simple currently, and create the limitation that
>> only key-based authentication is allowed, so that no interactive
>> prompt is necessary. However, all my attempts are unsuccessful so far.
>>
>> The code creates an object of class sshpeer to interact with the
>> remote repository. I tried adding interactive=False to the ui object,
>> closing stdin, but none of this works. The password prompt is always
>> presented.
>
> ssh and friends directly open /dev/tty, specifically to defeat these
> sorts of things and get the password prompt to the user without any
> interference.
>
>> Any ideas on how to disable the interactive nature of sshpeer in this context?
>
> Change the ssh configuration. See for instance BatchMode and
> PasswordAuthentication in ssh_config(5).
>

Thank you both to mentioning BatchMode. After using this ssh option,
the password prompt indeed disappeared.

I did however continue seeing interactive pop-ups from ssh-agent for
public key authentication with passphrase.
To make these disappear as well, I also had to set IdentitiesOnly=yes.

Thanks,
Thomas


More information about the Mercurial-devel mailing list