From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110848 invoked by alias); 3 Oct 2015 17:12:54 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 110840 invoked by uid 89); 3 Oct 2015 17:12:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f179.google.com Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com) (209.85.212.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 03 Oct 2015 17:12:52 +0000 Received: by wicfx3 with SMTP id fx3so65671454wic.0 for ; Sat, 03 Oct 2015 10:12:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:subject:date:message-id:to :mime-version; bh=Lm+v2NFyP9/prhsLqDUR6CD1lV6Nn8MBgvnEa1ZkoJE=; b=Xx1ibdINvXx0oG6RDxDF+eW+C3/um1KlIYhC6ZYAbKf1jDUE77Wpmz32Z74pg7zZ7F QyPfnDrDSHMNBcPXjsEAaeksKRggB1tGnj5HI0Nkn1Y8bIAa0pevWlKV1DtF9mZtC0aD 3mNjNuXVdkPG8c9PLWFuLI+0JNn6Rf7SJfNm6WDktAXekvdXCUCexQsso3CoaN37ulwa pypdNJuY7JDsU83/kg0Fc852Zt3VED3O9tOrEoQgFa/g0upc0UlaaL/xjWvaNQUhu+Tb 5yAKwYX1TwUMpfqNAVHwknKmX7S+gsU+hWwIkJyIP6Ttm6Slke7VNNbqqgfkHMva5xW9 TceA== X-Gm-Message-State: ALoCoQkw8JYdBFW9u4+cEqKbvYHxFoRl0Rzp68mvio181t94shpOi7Xl9psHVTErxWAfzmGNSmcE X-Received: by 10.180.103.199 with SMTP id fy7mr3170097wib.85.1443892369660; Sat, 03 Oct 2015 10:12:49 -0700 (PDT) Received: from [192.168.2.105] (p5DCB061C.dip0.t-ipconnect.de. [93.203.6.28]) by smtp.gmail.com with ESMTPSA id pk7sm17385138wjb.2.2015.10.03.10.12.48 for (version=TLS1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 03 Oct 2015 10:12:49 -0700 (PDT) From: Peter Moore X-Pgp-Agent: GPGMail 2.5.2 Content-Type: multipart/signed; boundary="Apple-Mail=_702751AD-EC79-4F3F-8F8E-667ACAADF4B8"; protocol="application/pgp-signature"; micalg=pgp-sha256 Subject: strange cygwin sshd user generated (user name includes machine name) Date: Sat, 03 Oct 2015 17:12:00 -0000 Message-Id: To: cygwin@cygwin.com Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-SW-Source: 2015-10/txt/msg00036.txt.bz2 --Apple-Mail=_702751AD-EC79-4F3F-8F8E-667ACAADF4B8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Content-length: 3182 Hi, I have a powershell script for installing cygwin and setting up sshd which = I am using as UserData when firing up a Windows 2012 R2 instance in AWS EC2. The same command succeeds when run manually, but fails when called from aut= omation. I=E2=80=99m trying to understand what it is that is different, so = I can fix it in automation. The command called is: ssh-host-config -y -c 'ntsec mintty' -u 'cygwinsshd' -w 'qwe123QWE!@#' When I run manually, logged in as Administrator, I get a log line like this= (notice the correct =E2=80=9CCygwin name=E2=80=9D): *** Query: Create new privileged user account 'WIN-EFPDIM0SAUP\cygwinsshd' = (Cygwin name: =E2=80=98cygwinsshd')? (yes/no) yes When I run from automation, the log line looks like this (notice the incorr= ect =E2=80=9CCygwin name=E2=80=9D): *** Query: Create new privileged user account 'WIN-EFPDIM0SAUP\cygwinsshd' = (Cygwin name: 'win-efpdim0saup+cygwinsshd')? (yes/no) yes It seems the extended =E2=80=9CCygwin name=E2=80=9D which I get in automati= on causes ssh-host-config to fail. I=E2=80=99m trying to establish what cau= ses the cygwin name to get the prefix of the machine name, since this seems= to cause the problem. For reference, below I=E2=80=99ve put the logs in both the successful (manu= al) case, and the failing (automated) case. If anyone can point me to the source code of ssh-host-config I=E2=80=99m al= so happy to dig - I couldn=E2=80=99t find it online. So if you=E2=80=99re n= ot sure, but know where the source is, I=E2=80=99m happy to look. Many thanks in advance! Pete SUCCESSFUL run (when executed manually): *** Query: Create new privileged user account 'WIN-EFPDIM0SAUP\cygwinsshd' = (Cygwin name: =E2=80=98cygwinsshd')? (yes/no) yes *** Info: User =E2=80=98cygwinsshd' has been created with password 'qwe123Q= WE!@#'. *** Info: If you change the password, please remember also to change the *** Info: password for the installed services which use (or will soon use) *** Info: the =E2=80=98cygwinsshd' account. *** Info: The sshd service has been installed under the =E2=80=98cygwinsshd' *** Info: account. To start the service now, call `net start sshd' or *** Info: `cygrunsrv -S sshd'. Otherwise, it will start automatically *** Info: after the next reboot. *** Info: Host configuration finished. Have fun! FAILED run (when called in automation): *** Query: Create new privileged user account 'WIN-EFPDIM0SAUP\cygwinsshd' = (Cygwin name: 'win-efpdim0saup+cygwinsshd')? (yes/no) yes *** Info: User 'win-efpdim0saup+cygwinsshd' has been created with password = 'qwe123QWE!@#'. *** Info: If you change the password, please remember also to change the *** Info: password for the installed services which use (or will soon use) *** Info: the 'win-efpdim0saup+cygwinsshd' account. *** Warning: Setting password expiry for user 'win-efpdim0saup+cygwinsshd' = failed! *** Warning: Please check that password never expires or set it to your nee= ds. No user or group 'win-efpdim0saup+cygwinsshd' known. *** Warning: Assigning the appropriate privileges to user 'win-efpdim0saup+= cygwinsshd' failed! *** ERROR: There was a serious problem creating a privileged user. --Apple-Mail=_702751AD-EC79-4F3F-8F8E-667ACAADF4B8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail Content-length: 495 -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQEcBAEBCAAGBQJWEAyPAAoJEIKV/ne0df68BecH/2xzj//gBaxKnGYzOP5gkz2B iZyTTdTPQLeIdYcLjPtHCzApjRKN2rPvPT+gnKrY6NgU6pNS67LtId5zIhDLCGf5 ZE3ygq22TzL38AEeo3zopG/4C1PVU8CGFNTvBoMd3+U0ThLmSznSU6DgcXDFIsUF Lp9M37xGI+6W4E9k+RAIYgR3jdpHlFcS5klfK2yKo5QlxObytdwx5Mpon0QoMNYH 3XMkl7H8KMu8zHJF7NbwEyLrqqE6iuhcLQoODmd0r6f/5pV64Xmru0MDXSfi1bE+ Mp31sITbh13t9z3S5lXFQ/D/frMQV7Rb+DOOgbJfRE0Ibm5miUPFp1toFR6OKuE= =bgh3 -----END PGP SIGNATURE----- --Apple-Mail=_702751AD-EC79-4F3F-8F8E-667ACAADF4B8--