This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problems with ssh-host-config on Windows 10


Hi all,

I've been trying to get a Cygwin sshd server running on a Windows 10
VM, and have found it to be surprisingly tricky without some
additional fiddling, and it's not clear to me whether that's expected
or if it's a bug.  I've attached the cygcheck output from the VM.

The symptom I've having seems to be the same as in this post:

https://cygwin.com/ml/cygwin/2015-06/msg00265.html

The problem seems to be stemming from some assumptions in:
/usr/share/csih/cygwin-service-installation-helper.sh

It creates the "privileged user" (in my case with the default name
cyg_server) with `net user`, including the SAM comment entry:

/comment:'<cygwin home="/var/empty" shell="/bin/false"/>'

Shortly after it calls:

passwd -e "${csih_PRIVILEGED_USERNAME}"

and this fails with:

Warning: Setting password expiry for user 'desktop-mk2koav+cyg_server' failed!

This happens because this is a fresh Cygwin install with all the
default settings in /etc/nsswitch.conf.  In particular, no passwd
entry is found for the cyg_server user unless I explicitly add "local"
to db_enum.  Furthermore, the SAM comment entry is not read correctly
without db_home: desc and db_shell: desc.  In summary, I had to edit
/etc/nsswitch.conf to:

passwd db
db_enum: local
db_home: desc
db_shell: desc

or else the cyg_server user's passwd entry is not read correctly and
the cygwin-server-installation-helper.sh script breaks when trying to
set up the new user.  Because the user is not configured properly (for
example, none of the editrights calls are made) it can't seteuid
properly and any attempt to log in via SSH errors out.

I'm not sure what the solution is.  Either the
cygwin-server-installation-helper.sh script should be improved to work
with the default nsswitch.conf settings, or the documentation for
setting up sshd could be better improved.

Thanks,
Erik

Attachment: cygcheck.log
Description: Binary data

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]