public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* rsync password prompt doesn't capture input and shows password in clear
@ 2021-03-10 18:11 Marki
  2021-03-10 20:58 ` Andrey Repin
  2021-03-11 10:14 ` Corinna Vinschen
  0 siblings, 2 replies; 10+ messages in thread
From: Marki @ 2021-03-10 18:11 UTC (permalink / raw)
  To: cygwin

Hello,

SSH password prompt captures the input correctly, and does not show it.

user@client /cygdrive/c/temp
$ ssh server
Password:
Password:

Rsync on the other hand won't even let me enter the password correctly.

user@client /cygdrive/c/temp
$ rsync -av xmppdb.db root@server:/tmp/
Password: 123
123
123
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at 
rsync.c(701) [sender=3.2.4dev]

user@client /cygdrive/c/temp
$ 123
-bash: 123: command not found

user@client /cygdrive/c/temp
$ 123
-bash: 123: command not found

user@client /cygdrive/c/temp
$ 123
-bash: 123: command not found

user@client /cygdrive/c/temp
$

Bye,
Marki


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

* Re: rsync password prompt doesn't capture input and shows password in clear
  2021-03-10 18:11 rsync password prompt doesn't capture input and shows password in clear Marki
@ 2021-03-10 20:58 ` Andrey Repin
  2021-03-10 22:42   ` Marki
  2021-03-11 10:14 ` Corinna Vinschen
  1 sibling, 1 reply; 10+ messages in thread
From: Andrey Repin @ 2021-03-10 20:58 UTC (permalink / raw)
  To: Marki, cygwin

Greetings, Marki!

> SSH password prompt captures the input correctly, and does not show it.

Unable to reproduce.

> user@client /cygdrive/c/temp
> $ ssh server
> Password:
> Password:

> Rsync on the other hand won't even let me enter the password correctly.

> user@client /cygdrive/c/temp
> $ rsync -av xmppdb.db root@server:/tmp/
> Password: 123
> 123
> 123
> rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at 
> rsync.c(701) [sender=3.2.4dev]

$ rsync -av ./server.sgc $REMOTE:/home/x/
$USER@$REMOTE's password:
sending incremental file list
rsync: mkdir "/home/x" failed: Permission denied (13)
rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.0]


> --

Please follow this guide:
> Problem reports:      https://cygwin.com/problems.html

See also:
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple


-- 
With best regards,
Andrey Repin
Wednesday, March 10, 2021 23:55:06

Sorry for my terrible english...


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

* Re: rsync password prompt doesn't capture input and shows password in clear
  2021-03-10 20:58 ` Andrey Repin
@ 2021-03-10 22:42   ` Marki
  2021-03-10 22:54     ` Andrey Repin
  0 siblings, 1 reply; 10+ messages in thread
From: Marki @ 2021-03-10 22:42 UTC (permalink / raw)
  To: cygwin, Andrey Repin

On March 10, 2021 9:58:14 PM GMT+01:00, Andrey Repin 
<anrdaemon@yandex.ru> wrote:
>Greetings, Marki!
>
>> SSH password prompt captures the input correctly, and does not show
>it.
>
>Unable to reproduce.

Unable to reproduce that SSH works as expected? Well, that's not good.

Anyway. I'll get back to you with the guides you provided.

Thanks.
Marki

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

* Re: rsync password prompt doesn't capture input and shows password in clear
  2021-03-10 22:42   ` Marki
@ 2021-03-10 22:54     ` Andrey Repin
  2021-03-10 23:20       ` Marki
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Repin @ 2021-03-10 22:54 UTC (permalink / raw)
  To: Marki, cygwin

Greetings, Marki!

> On March 10, 2021 9:58:14 PM GMT+01:00, Andrey Repin 

>>Greetings, Marki!
>>
>>> SSH password prompt captures the input correctly, and does not show
>>it.
>>
>>Unable to reproduce.

> Unable to reproduce that SSH works as expected? Well, that's not good.

wat…

You blamed rsync, I displayed that it works as expected.

> Anyway. I'll get back to you with the guides you provided.

Please don't quote cleartext emails. We do not endorse spam bots harvesting
addresses.


-- 
With best regards,
Andrey Repin
Thursday, March 11, 2021 1:52:31

Sorry for my terrible english...

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

* Re: rsync password prompt doesn't capture input and shows password in clear
  2021-03-10 22:54     ` Andrey Repin
@ 2021-03-10 23:20       ` Marki
  2021-03-11  2:11         ` David Dombrowsky
  0 siblings, 1 reply; 10+ messages in thread
From: Marki @ 2021-03-10 23:20 UTC (permalink / raw)
  To: cygwin

Hello,

First, I showed that SSH password prompt works as expected: you can 
input the password such that SSH client can process it, and it will not 
be echoed to the command prompt.

You claimed that you could not reproduce!? While that was the expected 
outcome for SSH. (It is working correctly)

Only then I showed that the same is not true for rsync. When I input a 
password, it will get echoed and also rsync will not process it, since 
standard input somehow goes elsewhere.

I am working on why rsync would behave like that on my end.

Thanks.


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

* Re: rsync password prompt doesn't capture input and shows password in clear
  2021-03-10 23:20       ` Marki
@ 2021-03-11  2:11         ` David Dombrowsky
  0 siblings, 0 replies; 10+ messages in thread
From: David Dombrowsky @ 2021-03-11  2:11 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 1118 bytes --]

On 3/10/21 6:20 PM, Marki wrote:
> Only then I showed that the same is not true for rsync. When I input a
> password, it will get echoed and also rsync will not process it, since
> standard input somehow goes elsewhere.

If I had to guess, it's probably the same as the problems I was seeing
with gpg-agent not being able to capture the tty correctly to prompt for
the password.  I never had a problem with the ssh agent though.

Unfortunately I do not have a good solution for it, as it seems to
happen only to some people some time on some systems.  After fighting
with it for an afternoon, I simply wrote a pinentry program with my
password hardcoded into it.  Yay for security.

The hack is here for reference (DO NOT USE ON PUBLIC PRODUCTION
MACHINES!) -> https://x.cygwin.com/ml/cygwin/2019-01/msg00178.html

I recheck the stock program every few months, and this problem still exists.

-- 
David Dombrowsky | Chief Software Engineer
6th Street Radio LLC | 6thstreetradio.org | 518-374-3204
https://www.linkedin.com/in/david-dombrowsky-94334415
VHVlIE1hciAgOSAwMjoxMzowMiBFU1QgMjAyMQo=


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: rsync password prompt doesn't capture input and shows password in clear
  2021-03-10 18:11 rsync password prompt doesn't capture input and shows password in clear Marki
  2021-03-10 20:58 ` Andrey Repin
@ 2021-03-11 10:14 ` Corinna Vinschen
  2021-03-11 10:42   ` Andrey Repin
  1 sibling, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2021-03-11 10:14 UTC (permalink / raw)
  To: Marki; +Cc: cygwin

On Mar 10 19:11, Marki wrote:
> Hello,
> 
> SSH password prompt captures the input correctly, and does not show it.
> 
> user@client /cygdrive/c/temp
> $ ssh server
> Password:
> Password:
> 
> Rsync on the other hand won't even let me enter the password correctly.
> 
> user@client /cygdrive/c/temp
> $ rsync -av xmppdb.db root@server:/tmp/
> Password: 123
> 123
> 123
> rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(701)
> [sender=3.2.4dev]

I tried this myself in mintty as well as in a Console window, and in
both cases the password was not echoed and taken correctly:

  $ rsync -av x.exe user@remote:/tmp/
  Password:
  sending incremental file list
  x.exe
  [...]

Are you sure you're using the Cygwin rsync?


Corinna

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

* Re: rsync password prompt doesn't capture input and shows password in clear
  2021-03-11 10:14 ` Corinna Vinschen
@ 2021-03-11 10:42   ` Andrey Repin
  2021-03-11 12:38     ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Repin @ 2021-03-11 10:42 UTC (permalink / raw)
  To: Corinna Vinschen via Cygwin, cygwin

Greetings, Corinna Vinschen via Cygwin!

> On Mar 10 19:11, Marki wrote:
>> Hello,
>> 
>> SSH password prompt captures the input correctly, and does not show it.
>> 
>> user@client /cygdrive/c/temp
>> $ ssh server
>> Password:
>> Password:
>> 
>> Rsync on the other hand won't even let me enter the password correctly.
>> 
>> user@client /cygdrive/c/temp
>> $ rsync -av xmppdb.db root@server:/tmp/
>> Password: 123
>> 123
>> 123
>> rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(701)
>> [sender=3.2.4dev]

> I tried this myself in mintty as well as in a Console window, and in
> both cases the password was not echoed and taken correctly:

>   $ rsync -av x.exe user@remote:/tmp/
>   Password:
>   sending incremental file list
>   x.exe
>   [...]

> Are you sure you're using the Cygwin rsync?

-rsync
+ssh

There's no MS-provided rsync, but there's ssh in C:\Windows\System32\OpenSSH\


-- 
With best regards,
Andrey Repin
Thursday, March 11, 2021 13:40:03

Sorry for my terrible english...


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

* Re: rsync password prompt doesn't capture input and shows password in clear
  2021-03-11 10:42   ` Andrey Repin
@ 2021-03-11 12:38     ` Corinna Vinschen
  2021-03-11 12:53       ` Takashi Yano
  0 siblings, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2021-03-11 12:38 UTC (permalink / raw)
  To: cygwin

On Mar 11 13:42, Andrey Repin wrote:
> Greetings, Corinna Vinschen via Cygwin!
> 
> > On Mar 10 19:11, Marki wrote:
> >> Hello,
> >> 
> >> SSH password prompt captures the input correctly, and does not show it.
> >> 
> >> user@client /cygdrive/c/temp
> >> $ ssh server
> >> Password:
> >> Password:
> >> 
> >> Rsync on the other hand won't even let me enter the password correctly.
> >> 
> >> user@client /cygdrive/c/temp
> >> $ rsync -av xmppdb.db root@server:/tmp/
> >> Password: 123
> >> 123
> >> 123
> >> rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(701)
> >> [sender=3.2.4dev]
> 
> > I tried this myself in mintty as well as in a Console window, and in
> > both cases the password was not echoed and taken correctly:
> 
> >   $ rsync -av x.exe user@remote:/tmp/
> >   Password:
> >   sending incremental file list
> >   x.exe
> >   [...]
> 
> > Are you sure you're using the Cygwin rsync?
> 
> -rsync
> +ssh
> 
> There's no MS-provided rsync, but there's ssh in C:\Windows\System32\OpenSSH\

If that ssh is first in $PATH, then that's the potential problem.


Corinna

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

* Re: rsync password prompt doesn't capture input and shows password in clear
  2021-03-11 12:38     ` Corinna Vinschen
@ 2021-03-11 12:53       ` Takashi Yano
  0 siblings, 0 replies; 10+ messages in thread
From: Takashi Yano @ 2021-03-11 12:53 UTC (permalink / raw)
  To: cygwin

On Thu, 11 Mar 2021 13:38:58 +0100
Corinna Vinschen wrote:
> On Mar 11 13:42, Andrey Repin wrote:
> > Greetings, Corinna Vinschen via Cygwin!
> > 
> > > On Mar 10 19:11, Marki wrote:
> > >> Hello,
> > >> 
> > >> SSH password prompt captures the input correctly, and does not show it.
> > >> 
> > >> user@client /cygdrive/c/temp
> > >> $ ssh server
> > >> Password:
> > >> Password:
> > >> 
> > >> Rsync on the other hand won't even let me enter the password correctly.
> > >> 
> > >> user@client /cygdrive/c/temp
> > >> $ rsync -av xmppdb.db root@server:/tmp/
> > >> Password: 123
> > >> 123
> > >> 123
> > >> rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(701)
> > >> [sender=3.2.4dev]
> > 
> > > I tried this myself in mintty as well as in a Console window, and in
> > > both cases the password was not echoed and taken correctly:
> > 
> > >   $ rsync -av x.exe user@remote:/tmp/
> > >   Password:
> > >   sending incremental file list
> > >   x.exe
> > >   [...]
> > 
> > > Are you sure you're using the Cygwin rsync?
> > 
> > -rsync
> > +ssh
> > 
> > There's no MS-provided rsync, but there's ssh in C:\Windows\System32\OpenSSH\
> 
> If that ssh is first in $PATH, then that's the potential problem.

That seems to be the cause. I can reproduce the issue by:

env PATH="/cygdrive/c/Windows/system32/OpenSSH:$PATH" rsync -av somefile user@server:/tmp

in mintty with 64bit cygwin.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

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

end of thread, other threads:[~2021-03-11 12:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 18:11 rsync password prompt doesn't capture input and shows password in clear Marki
2021-03-10 20:58 ` Andrey Repin
2021-03-10 22:42   ` Marki
2021-03-10 22:54     ` Andrey Repin
2021-03-10 23:20       ` Marki
2021-03-11  2:11         ` David Dombrowsky
2021-03-11 10:14 ` Corinna Vinschen
2021-03-11 10:42   ` Andrey Repin
2021-03-11 12:38     ` Corinna Vinschen
2021-03-11 12:53       ` Takashi Yano

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).