This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

strange cygwin sshd user generated (user name includes machine name)


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: signature.asc
Description: Message signed with OpenPGP using GPGMail


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]