1

For example, I need to switch Cygwin sshd service from 'ntsec' to 'nontsec' mode on quite a few Windows machines without re-installing the service.

Linulin
  • 123
  • 8

1 Answers1

1

The variables are stored under

/HKLM/SYSTEM/CurrentControlSet/Services/{service name}/Parameters/Environment

registry key. So, the following commands do the trick for sshd example:

regtool set /HKLM/SYSTEM/CurrentControlSet/Services/sshd/Parameters/Environment/CYGWIN nontsec
# don't run the following commands one-by-one unless you want to lose remote access
cygrunsrv -E sshd && cygrunsrv -S sshd
Linulin
  • 123
  • 8