Created
June 1, 2016 17:23
-
-
Save kwart/f065a811d311fcaaf914534d3ccf3604 to your computer and use it in GitHub Desktop.
Cygwin sshd service regenerates /etc/passwd with local users when the service is started
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ssh-host-config.orig 2016-06-01 17:05:03.676035200 +0000 | |
+++ ssh-host-config 2016-06-01 17:08:12.793684500 +0000 | |
@@ -475,8 +475,9 @@ | |
csih_inform "will start automatically after the next reboot." | |
fi | |
else | |
- if /usr/bin/cygrunsrv -I ${service_name} -d "CYGWIN ${service_name}" -p /usr/sbin/sshd \ | |
- -a "-D" -y tcpip "${cygwin_env[@]}" \ | |
+ if /usr/bin/cygrunsrv -I ${service_name} -d "CYGWIN ${service_name}" -p /bin/bash \ | |
+-a "-c '/usr/bin/mkpasswd -l -b > /etc/passwd; /usr/sbin/sshd -D'" \ | |
+ -y tcpip "${cygwin_env[@]}" \ | |
-u "${run_service_as}" -w "${password}" | |
then | |
/usr/bin/editrights -u "${run_service_as}" -a SeServiceLogonRight |
Author
kwart
commented
Jun 1, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment