public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* interactive hg (mercurial) using ssh is getting "authentication failures" to sourceforge
@ 2014-05-11  1:21 Ernie Rael
  2014-05-12 12:20 ` Andrey Repin
  0 siblings, 1 reply; 4+ messages in thread
From: Ernie Rael @ 2014-05-11  1:21 UTC (permalink / raw)
  To: cygwin

I'm running under mintty (same failure under cmd running "bash --login -i").
(I have only tried this to sourceforge)
In ssh log (see more detailed output further down) there is a suspicious
     debug1: read_passphrase: can't open /dev/tty: No such device or address

At the end of this post, there is experimental evidence that the ssh is
disasociated from the tty in the when spawned by hg. It is also shown that
the original environment is preserved.

I should be prompted for a passwword by ssh, but I'm seeing
     /jvi/ $ hg out
     comparing with ssh://err@hg.code.sf.net/p/jvi/code
     remote: Received disconnect from 216.34.181.156: 2: Too many 
authentication failures for err
     abort: no suitable response from remote hg!

NOTE: hg is a Win7 command, not compiled with the cygwin dll.

If I register id_dsa.pub with my account at sourceforge (through a web
interface, not simply putting the file in ~/.ssh/) then "hg out' completes
successfully (perhaps since no password is needed).

ssh works in general, I've used it to shell.sf.net,
and if I go directly to hg.code.sf.net I see
     /jvi/ $ ssh err@hg.code.sf.net
     Password:
but after entering password this direct access is terminated by 
sourceforge as expected.

Getting debug info from both hg and ssh gives on the console
     /jvi/ $ hg --debug -v out -e 'ssh -v -v -v -E 
c:/cygwin64/tmp/ssh.log -l err'
     comparing with ssh://err@hg.code.sf.net/p/jvi/code
     running ssh -v -v -v -E c:/cygwin64/tmp/ssh.log -l err 
err@hg.code.sf.net "hg -R p/jvi/code serve --stdio"
     sending hello command
     sending between command
     abort: no suitable response from remote hg!
and at the end of the ssh.log repeated 3 times there is
     debug2: userauth_kbdint
     debug2: we sent a keyboard-interactive packet, wait for reply
     debug2: input_userauth_info_req
     debug2: input_userauth_info_req: num_prompts 1
     debug1: read_passphrase: can't open /dev/tty: No such device or address
     debug3: packet_send2: adding 32 (len 14 padlen 18 extra_pad 64)
and finally
     Received disconnect from 216.34.181.156: 2: Too many authentication 
failures for err

System setup and cygwin install over last month, and settup has no 
pending downloads.
     /jvi/ $ uname -a
     CYGWIN_NT-6.1 spirit 1.7.29(0.272/5/3) 2014-04-07 13:46 x86_64 Cygwin

Looking at the source code of ssh, and assuming that
openbsd-compat/readpassphrase.c is used, then /dev/tty open error is the
problem.  (AFAICT)

I first saw the failure on this new install. Then went back to an old
system and I see the failure there as well. It used to work sometime in Q4
of 2013 on old system. Since then sourceforge has changed, I've updated
cygwin's dll and ssh on old system (so ssh between my old/new would be
working from same binaries, doh!). And I've probably changed other things as
well.  (I may be able to go to a backup on the old system to see if it
works, but I'd prefer to move forward...)

-ernie

==================
=== Experiment ===
==================

Have hg spawn a shell script, and get a look at the environment.
The script is invoked like: "sf-ssh /dev/pty0",
and in the script try to do $(tty) and access a shell variable
in hg's environment. The bash can access the pseudo tty, but doing
"tty" command fails. The environment is preserved.

=== The script: "c:/err/bin/sf-ssh"
     #!/usr/bin/bash

     (
         echo dollar-star: $*
         echo tty: $(tty)
         echo $XYZZY
     ) > /tmp/sf-ssh.$$ 2>&1

     echo NOTICE THIS DIRECT WRITE TO PSEUDO TTY $1 > $1

=== The command and it's console output
     /jvi/ $ XYZZY=magic-spell hg --debug -v out -e "bash -c 
'c:/err/bin/sf-ssh $(tty)'"
     NOTICE THIS DIRECT WRITE TO PSEUDO TTY /dev/pty0
     comparing with ssh://err@hg.code.sf.net/p/jvi/code
     running bash -c 'c:/err/bin/sf-ssh /dev/pty0' err@hg.code.sf.net 
"hg -R p/jvi/code serve --stdio"
     sending hello command
     sending between command
     abort: no suitable response from remote hg!

=== The output in /tmp/sf-ssh.$$

     /jvi/ $ cat /tmp/sf-ssh.8700
     dollar-star: /dev/pty0
     tty: not a tty
     magic-spell


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: interactive hg (mercurial) using ssh is getting "authentication failures" to sourceforge
  2014-05-11  1:21 interactive hg (mercurial) using ssh is getting "authentication failures" to sourceforge Ernie Rael
@ 2014-05-12 12:20 ` Andrey Repin
  2014-05-12 14:37   ` Ernie Rael
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Repin @ 2014-05-12 12:20 UTC (permalink / raw)
  To: Ernie Rael, cygwin

Greetings, Ernie Rael!

> At the end of this post, there is experimental evidence that the ssh is
> disasociated from the tty in the when spawned by hg.

> NOTE: hg is a Win7 command, not compiled with the cygwin dll.

Don't you see anything suspicious here?


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 12.05.2014, <15:20>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: interactive hg (mercurial) using ssh is getting "authentication failures" to sourceforge
  2014-05-12 12:20 ` Andrey Repin
@ 2014-05-12 14:37   ` Ernie Rael
  2014-05-12 18:11     ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 4+ messages in thread
From: Ernie Rael @ 2014-05-12 14:37 UTC (permalink / raw)
  To: cygwin

On 5/12/2014 4:20 AM, Andrey Repin wrote:
> Greetings, Ernie Rael!
>
>> At the end of this post, there is experimental evidence that the ssh is
>> disasociated from the tty in the when spawned by hg.
>> NOTE: hg is a Win7 command, not compiled with the cygwin dll.
> Don't you see anything suspicious here?
>
Right you are. After I posted, I realized I hadn't clearly stated my 
questions. This could be something about my setup, but... I've only just 
joined this mailing list; I don't have an historical perspective.

Is this expected behavior? If so, any idea what changed over the last 6 
- 9 months? Was this a conscious change in behavior?

I'd been using this setup for years; the old behavior, which gives a 
higher degree of interoperability (at least in this case), is certainly 
natural. If the Win program didn't do anything explicit to disassociate 
from the tty, why shouldn't it work? Does windows have a concept of 
controlling tty? Is there something mercurial/python could, as a native 
app, that would get this to work?

I know little about windows' internals. I understand that even though it 
used to work, that it may have been a 'fortunate" accident.

-ernie

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: interactive hg (mercurial) using ssh is getting "authentication failures" to sourceforge
  2014-05-12 14:37   ` Ernie Rael
@ 2014-05-12 18:11     ` Larry Hall (Cygwin)
  0 siblings, 0 replies; 4+ messages in thread
From: Larry Hall (Cygwin) @ 2014-05-12 18:11 UTC (permalink / raw)
  To: cygwin

On 05/12/2014 09:21 AM, Ernie Rael wrote:
> On 5/12/2014 4:20 AM, Andrey Repin wrote:
>> Greetings, Ernie Rael!
>>
>>> At the end of this post, there is experimental evidence that the ssh is
>>> disasociated from the tty in the when spawned by hg.
>>> NOTE: hg is a Win7 command, not compiled with the cygwin dll.
>> Don't you see anything suspicious here?
>>
> Right you are. After I posted, I realized I hadn't clearly stated my
> questions. This could be something about my setup, but... I've only just
> joined this mailing list; I don't have an historical perspective.
>
> Is this expected behavior? If so, any idea what changed over the last 6 - 9
> months? Was this a conscious change in behavior?
>
> I'd been using this setup for years; the old behavior, which gives a higher
> degree of interoperability (at least in this case), is certainly natural. If
> the Win program didn't do anything explicit to disassociate from the tty,
> why shouldn't it work? Does windows have a concept of controlling tty? Is
> there something mercurial/python could, as a native app, that would get this
> to work?
>
> I know little about windows' internals. I understand that even though it
> used to work, that it may have been a 'fortunate" accident.

I believe the point that Andrey's making is that 'hg' being a Windows
native app is significant in your workflow.  When you wander into the
area that involves ttys, there are more restrictions on what will work.
Windows doesn't have ttys and Cygwin emulates them.  Mixing tools
which don't understand ttys with those that emulate them is not a
recipe for success, even if things work OK in some situations.  Your
simplest route to a solution may be to just use the Cygwin version
of 'hg'.


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-12 18:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-11  1:21 interactive hg (mercurial) using ssh is getting "authentication failures" to sourceforge Ernie Rael
2014-05-12 12:20 ` Andrey Repin
2014-05-12 14:37   ` Ernie Rael
2014-05-12 18:11     ` Larry Hall (Cygwin)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).