public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Peter Moore <pmoore@mozilla.com>
To: cygwin@cygwin.com
Subject: strange cygwin sshd user generated (user name includes machine name)
Date: Sat, 03 Oct 2015 17:12:00 -0000	[thread overview]
Message-ID: <E7EAC5BC-C386-448C-B40D-53A1096374F2@mozilla.com> (raw)

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

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 automation. I’m 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 “Cygwin name”):

*** Query: Create new privileged user account 'WIN-EFPDIM0SAUP\cygwinsshd' (Cygwin name: ‘cygwinsshd')? (yes/no) yes

When I run from automation, the log line looks like this (notice the incorrect “Cygwin name”):

*** Query: Create new privileged user account 'WIN-EFPDIM0SAUP\cygwinsshd' (Cygwin name: 'win-efpdim0saup+cygwinsshd')? (yes/no) yes

It seems the extended “Cygwin name” which I get in automation causes ssh-host-config to fail. I’m trying to establish what causes the cygwin name to get the prefix of the machine name, since this seems to cause the problem.

For reference, below I’ve put the logs in both the successful (manual) case, and the failing (automated) case.

If anyone can point me to the source code of ssh-host-config I’m also happy to dig - I couldn’t find it online. So if you’re not sure, but know where the source is, I’m happy to look.

Many thanks in advance!
Pete



SUCCESSFUL run (when executed manually):

*** Query: Create new privileged user account 'WIN-EFPDIM0SAUP\cygwinsshd' (Cygwin name: ‘cygwinsshd')? (yes/no) yes
*** Info: User ‘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 ‘cygwinsshd' account.

*** Info: The sshd service has been installed under the ‘cygwinsshd'
*** 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 needs.
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.


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

             reply	other threads:[~2015-10-03 17:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03 17:12 Peter Moore [this message]
2015-10-03 18:27 ` Peter Moore
2016-03-31 19:13   ` Peter Moore
2015-10-10  4:06 ` Linda Walsh
2016-03-31 19:23 Pete Moore

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=E7EAC5BC-C386-448C-B40D-53A1096374F2@mozilla.com \
    --to=pmoore@mozilla.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).