sshd
Andrey Repin
anrdaemon@yandex.ru
Mon Feb 14 06:56:24 GMT 2022
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...
More information about the Cygwin
mailing list