public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: Ernie Rael <err@raelity.com>, cygwin@cygwin.com
Subject: Re: sshd
Date: Mon, 14 Feb 2022 09:56:24 +0300	[thread overview]
Message-ID: <553466060.20220214095624@yandex.ru> (raw)
In-Reply-To: <a6282714-ab39-9f64-a099-e2d7d3d1bb28@raelity.com>

Greetings, Ernie Rael!

> On 2/12/22 9:29 PM, Mark Geisert wrote:
>> Ernie Rael wrote:
>>> Hi all,
>>>
>>> I set up cygwin several years ago and have only had one system at 
>>> home. I've recently got a 2nd, linux.
>>>
>>> I've used ssh locally under cygwin, primarily to get a term for a use 
>>> with admin priv. And I can ssh from cygwin to the linux machine. On 
>>> cygwin I see
>>>
>>>     $ ps -ef |grep sshd
>>>     cyg_serv     255     254 ?          Feb  1 /usr/sbin/sshd
>>>
>>> But ssh from linux to cygwin hangs (finally times out). Ping works 
>>> linux --> windows.
>>>
>>> I must have run ssh-host-config way back when. Can I just run it again?
>>>
>>> Suggestions for something else to try and/or triage the problem?
>>
>> You might try the following.  Determine the Windows pid of your sshd 
>> process, then use netstat to see if that process is listening on the 
>> sshd port.  Here's what a successful check looks like:
>>
>> ~ ps -as|grep sshd
>>   42834 ?          Jan 16 /usr/sbin/sshd
>>
>> ~ ps -lp 42834
>>       PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
>>     42834   42832   42834       5972  ?         197612   Jan 16 
>> /usr/sbin/sshd
>>
>> ~ netstat -ao|grep 5972
>>   TCP    0.0.0.0:22             zotac:0 LISTENING       5972
>>   TCP    [::]:22                zotac:0 LISTENING       5972
>>
>> If the two output lines aren't there, I'd suspect a Windows firewall 
>> has TCP port 22 walled off.  ("zotac" is my machine name; you'll see 
>> something different there.)
>> HTH,
>>
>> ..mark
>>
> Thanks Mark,

> Doesn't seem to be a firewall issue. NetStat took about 90 seconds.

> $ ps -lp 255
>        PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
>        255     254     255       4176  ?           1006   Feb  1 
> /usr/sbin/sshd

> $ netstat -ao | grep 4176
>    TCP    0.0.0.0:22             spirit:0 LISTENING       4176
>    TCP    [::]:22                spirit:0 LISTENING       4176

Open Windows Firewall (cygstart WF.msc), find all your sshd rules and trash
them. Manually create (or tweak Windows sshd one) a single rule for port
rather than executable.
Additionally, to resolve conflicts with stock sshd, create a file
%ProgramData%\ssh\sshd_config with single line `Port 2022` (for example).


-- 
With best regards,
Andrey Repin
Monday, February 14, 2022 9:34:52

Sorry for my terrible english...

  parent reply	other threads:[~2022-02-14  7:05 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-13  2:25 sshd Ernie Rael
2022-02-13  5:29 ` sshd Mark Geisert
2022-02-13  6:30   ` sshd Russell VT
2022-02-13 12:42     ` sshd Ernie Rael
2022-02-13 12:38   ` sshd Ernie Rael
2022-02-13 19:59     ` sshd Erik Soderquist
2022-02-14  6:56     ` Andrey Repin [this message]
2022-02-14  7:42       ` sshd Ernie Rael
2022-02-15 17:20         ` sshd Gajanana Shridhar
  -- strict thread matches above, loose matches on Subject: below --
2010-05-13 20:08 sshd Steven Collins
2010-05-13 20:12 ` sshd Eric Berge
2010-05-13 20:18   ` sshd Steven Collins
2010-05-13 20:32     ` sshd Eric Berge
2010-05-13 20:38       ` sshd Steven Collins
2010-05-13 20:17 ` sshd Andrew Dunstan
2010-05-13 20:31   ` sshd Steven Collins
2006-04-20 18:49 sshd Steve Kelem
2006-04-20 19:22 ` sshd René Berber
2003-10-15 14:52 sshd e-bone
2003-10-15 15:32 ` sshd Larry Hall
2002-12-18 13:25 sshd Harig, Mark A.
2002-12-18 10:19 sshd Vince Hoffman
2002-12-18  9:21 sshd Vince Hoffman
2002-12-18  9:03 sshd Vince Hoffman
2002-12-18  8:00 sshd Stuardo Rodriguez
2002-07-02 19:53 sshd Bryan Zimmer
2002-07-03  1:39 ` sshd Corinna Vinschen
2002-07-03  8:01   ` sshd Bryan Zimmer
2002-07-03  8:53     ` sshd Corinna Vinschen
2002-03-02 13:23 sshd Erik Vigmostad
2002-03-04  8:37 ` sshd Larry Hall (RFK Partners, Inc)
2001-05-31  0:46 sshd Warunee Noiarun
2001-05-31  3:03 ` sshd Corinna Vinschen
2001-03-16 15:07 sshd Bret Jordan
1999-04-13 12:10 SSHD Gerhardstein, Lawrence H
1999-04-30 18:32 ` SSHD Gerhardstein, Lawrence H
     [not found] <862566DC.00528EDA.00@marker.its.uiowa.edu>
1998-12-16 16:28 ` SSHD JJ Streicher-Bremer
1998-10-13 12:17 sshd Juha Jäykkä
1998-01-07 14:50 sshd Derek Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=553466060.20220214095624@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    --cc=err@raelity.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).