public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Nick.Battle@uk.fujitsu.com" <Nick.Battle@uk.fujitsu.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Problem with ssh-host-config?
Date: Fri, 11 Mar 2016 12:39:00 -0000	[thread overview]
Message-ID: <869e15d0ccf54bd5ac85e8896f61592e@R01UKEXCASM112.r01.fujitsu.local> (raw)

I'm having a strange problem with the sshd configuration script on Windows 8. I'm calling it as follows, where I expect both the fjsupport Windows user account and /etc/passwd entry to be created by the script:

/bin/ssh-host-config -y -c ntsec -u fjsupport -w <the password>

If the user has no entry in /etc/passwd, it creates the Windows account, but then complains when it comes to create the sshd service that the privileged user does not exist (I think it means in /etc/passwd). If I add the user to /etc/passwd (using mkpasswd after the first run) and just remove the Windows account, then it sees that the user exists in /etc/passwd and does not attempt to create a Windows account, then complaining that it cannot use the (non-existent) Windows user when it tries to create the service. If I have both the Windows account (with privileges) and the /etc/passwd entry beforehand, everything is fine, but of course it doesn't have to make either.

By stepping through the script (incidentally, the -d flag doesn't work properly?), I found that the csih_create_privileged_user function is using the variable ${username} to write to /etc/passwd. But when called as above this variable is not set. So that doesn't update /etc/passwd and it (later) thinks the user is not known. This is at line 3069 in cygwin-service-installation-helper.sh.

/usr/bin/mkpasswd -l -u "${username}" >> "${SYSCONFDIR}/passwd"

Changing ${username} to ${csih_PRIVILEGED_USERNAME} seems to fix the problem and everything works as expected.

So I have the result I want, but I'm not sure that the fix above is correct. Isn't it normal to use ssh-host-config to create the user in Windows and /etc/passwd? In which case why isn't everyone getting this problem? Or am I using the script the wrong way?

-- 
Cheers,
-nick

Unless otherwise stated, this email has been sent from Fujitsu Services Limited, from Fujitsu (FTS) Limited, or from Fujitsu Telecommunications Europe Limited, together "Fujitsu".

This email is only for the use of its intended recipient.  Its contents are subject to a duty of confidence and may be privileged.  Fujitsu does not guarantee that this email has not been intercepted and amended or that it is virus-free.

Fujitsu Services Limited, registered in England No 96056, registered office 22 Baker Street, London W1U 3BW.

Fujitsu (FTS) Limited, registered in England No 03808613, registered office 22 Baker Street, London W1U 3BW.

PFU Imaging Solutions Europe Limited, registered in England No 1578652, registered office Hayes Park Central, Hayes End Road, Hayes, Middlesex, UB4 8FE.

Fujitsu Telecommunications Europe Limited, registered in England No 2548187, registered office Solihull Parkway, Birmingham Business Park, Birmingham, B37 7YU.

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

             reply	other threads:[~2016-03-11 12:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 12:39 Nick.Battle [this message]
2016-03-11 14:01 ` Achim Gratz
2016-03-11 15:41   ` Corinna Vinschen
2016-03-15 15:42     ` Nick.Battle
2016-03-16 10:05       ` Corinna Vinschen

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=869e15d0ccf54bd5ac85e8896f61592e@R01UKEXCASM112.r01.fujitsu.local \
    --to=nick.battle@uk.fujitsu.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).