delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/03/11/07:40:04

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=iW+
2YPmFYMdfoXpbw2JkZIbDmQTPznCsx81rbTJ+x05MUgKI4H4rfJPfIapCi139P+D
NUTJCdSWAKKH3atI6yKGT4t/GgVLsmFW77aJORosDvDIXgcuki0AscCjJbKgMROK
JhjQ2a/Sov3T5B5OayvmXM8HrGnDU5NpmXhAQPyo=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; s=default; bh=ny0tsQGpe
n4h+nF8xAJeblj3Zto=; b=L5vT4xVdYKFYiq2DeX1YJAHl4t0VMFnkgW4Qqe903
fb8hGhhIA5mb3zRkJ2drNmR9sVy4Dgcr5bD4LoziMyandALeeAeDCIE9OmoxAaL3
Jb828VsKCws458ITXix/C0U9ImNcIr7lYUXV08D3OJYVkw3R7eECP5PT5luY8666
dI=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: Yes, score=6.6 required=5.0 tests=AWL,BAYES_60,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 spammy=baker, Baker, intercepted, virus-free
X-HELO: mail1.bemta5.messagelabs.com
X-Env-Sender: Nick DOT Battle AT uk DOT fujitsu DOT com
X-Msg-Ref: server-10.tower-36.messagelabs.com!1457699972!22153031!1
X-StarScan-Received:
X-StarScan-Version: 8.11; banners=uk.fujitsu.com,-,-
X-VirusChecked: Checked
From: "Nick DOT Battle AT uk DOT fujitsu DOT com" <Nick DOT Battle AT uk DOT fujitsu DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Problem with ssh-host-config?
Date: Fri, 11 Mar 2016 12:39:31 +0000
Message-ID: <869e15d0ccf54bd5ac85e8896f61592e@R01UKEXCASM112.r01.fujitsu.local>
x-ms-exchange-transport-fromentityheader: Hosted
MIME-Version: 1.0
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u2BCdw9Z015010

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019