How does sshd under cygwin authenticate?

1

2

I know very little of Windows yet I have to work with a Windows server. The only way to make this bearable is with Cygwin and sshd. I have installed and configured sshd but I don't really understand how it's doing authentication. And I also don't manage to log in, even though it's definitely running on port 22.

I have successfully used cygwin+ssh in the past (without much understanding of authentication). Both of those times I managed to get it working with local users. This time there's an entire LDAP-ish system as well (not sure what it's called in Windows).

There's an /etc/passwd file which is I generated with mkpasswd. Is there a simple way to add a user there that I can log in with?

There is talk about the CYGWIN environment variable, supposed to be set in C:\cygwin\Cygwin.bat, but I'm not sure how it affects things:

set CYGWIN=binmode tty ntsec

How does the OpenSSH server authenticate under Windows/Cygwin? How can I add one basic local user to use over SSH? How can I add one local user with administrator rights to use over SSH?

kqw

Posted 2015-06-02T15:06:07.223

Reputation: 1 781

Answers

1

sshd is using the same users as Windows. The now optional /etc/passwd is used for storing the alternate cygwin name of the window user (same SSID) or to specify the HOME directory or the preferred shell.

The authentification method for the user is defined in its own ~/.ssh/config file same as on other Unix systems. Use

/usr/bin/ssh-host-config
/usr/bin/ssh-user-config

to configure server and user. Please note that all these settings are now obsolete.

set CYGWIN=binmode tty ntsec

Read https://cygwin.com/docs.html for updated info.

matzeri

Posted 2015-06-02T15:06:07.223

Reputation: 1 662

3Do you mean that set CYGWIN=binmode tty ntsec is obsolete? I don't think pointing to main page of the Cygwin docs is very useful in this case. – kqw – 2015-07-11T16:58:59.520

@matzeri is ntsec still required? – pinkpanther – 2017-11-22T19:00:39.417