public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Problems with ssh-host-config on Windows 10
Date: Sun, 12 Feb 2017 11:09:00 -0000	[thread overview]
Message-ID: <20170212110946.GD11666@calimero.vinschen.de> (raw)
In-Reply-To: <CAOTD34ZEgZQ-iOPwtQEByyFs++FcqC9CXmbOgbeYWWfBeQdnWA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2413 bytes --]

On Feb  6 10:51, Erik Bray wrote:
> On Thu, Feb 2, 2017 at 2:08 PM, Corinna Vinschen
> <corinna-cygwin@cygwin.com> wrote:
> > On Feb  2 12:19, Erik Bray wrote:
> >> 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
> >
> > The assumption in ssh-host-config is that your nsswitch.conf settings
> > are already correct.  It's kind of tricky to set up accounts and stuff
> > in a not yet configured environment.
> 
> I think that's reasonable, but the question is what is "correct"?  Any
> valid settings for nsswitch.conf could be "correct" for different use
> cases, whereas the cygwin-service-installation-helper.sh script seems
> to have some very specific requirements that don't match the default
> configuration, or even many non-default configurations (especially
> w.r.t. db_home and db_shell).

The script depends on what's returned by tools like getent, mkpasswd and
mkgroup.  Those in turn depend on the nsswitch.conf settings.  If
there's a bug in there, I'd be grateful for a fix.  Maybe at one point
it should call mkpasswd instead of getent, the former not depending on
db_enum, in contrast to the latter?

Or maybe the default for db_enum is the actual problem?  Maybe it should
be set to cache + builtin + local accounts?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2017-02-12 11:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 11:20 Erik Bray
2017-02-02 13:08 ` Corinna Vinschen
2017-02-06  9:51   ` Erik Bray
2017-02-12 11:09     ` Corinna Vinschen [this message]

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=20170212110946.GD11666@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.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).