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]

Re: Installing sshd with option --type manual


On 2017-05-09 23:05, Charles Russell wrote:
>> On 5/4/2017 3:31 PM, Fran Litterio wrote:
>>> You can try opening the Services Control Panel app (run "start 
>>> services.msc" in a Command Prompt) and changing the startup type
>>> of service "Cygwin sshd" to "Automatic (Delayed Start)".
> Yes! I was looking in the alphabetized list of services for sshd, not
> for CYGWIN sshd.

...or from an elevated admin shell where you installed the Cygwin 
service with cygrunsrv -I or ran the /bin/...-config script e.g.:

	$ sc config sshd start= delayed-auto depend= cygserver/tcpip

no space before = (part of option), space between = and value required, 
services it should start after and depends on separated by forward slashes.

>From any shell, you can list installed Cygwin services using 

	$ cygrunsrv -L

with -V also listing all parameters and their values.

>From any shell, you can also list and modify parameters easily using e.g.

$ regtool list -p /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd
Parameters\
Type
Start
ErrorControl
ImagePath
DisplayName
DependOnService
ObjectName
$ regtool set -d /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/DelayedAutostart 1
$ regtool list -p /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd
Parameters\
Type
Start
ErrorControl
ImagePath
DisplayName
DependOnService
ObjectName
DelayedAutostart
$ regtool get /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/DelayedAutostart
1
$ regtool list -p /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/Parameters
AppPath
AppArgs
$ regtool set -d /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/Parameters/Preshutdown 1
$ regtool list -p /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/Parameters
AppPath
AppArgs
Preshutdown
$ regtool get /HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/sshd/Parameters/Preshutdown
1

with the usual caveats regarding registry key names, changes, and 
modifications.
Parameters and other cygrunsrv changes will not be picked up until 
the service is stopped and restarted from cygrunsrv in an elevated 
admin shell.

This approach has the advantages that cygrunsrv does not support 
service or parameter changes or modifications, cygrunsrv -I and 
sc config require an elevated admin shell, sc config does not support 
cygrunsrv and other services' Parameters and other features, and 
regedit requires formatted file input or a GUI.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
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


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