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