Cygwin: Couldn't determine name of user running sshd service from account database

2

I've been following a tutorial on youtube here: SFTP Setup

And I've been following all the steps exactly but I've run into a problem in Cygwin while trying to install SSH.

Upon opening the Cygwin64 Terminal I typed the following

$ export CYGWIN='ntsec tty'
$ chmod 0755 /var
$ ssh-host-config

Then I get to the questions

The first question is Should StrictModes be used? (yes/no) where I type no. The next question is Should privilege separation be used? (yes/no) where I type yes.

Then I get the following error/warning (Regardless of whether I select no or yes):

*** Warning: Couldn't determine name of user running sshd service from account database!
*** Warning: As a result, this script cannot make sure that the files used
*** Warning: by the sshd service belong to the user running the service.

*** Warning: Host configuration exited with 1 errors or warnings!
*** Warning: Make sure that all problems reported are fixed,
*** Warning: then re-run ssh-host-config

I'm not sure how to resolve these errors! What should I do?

Barry Michael Doyle

Posted 2016-07-28T12:46:39.577

Reputation: 123

Answers

1

The error message refers to the "user running sshd service". It occurs because there is already an sshd service owned by a different user, (for me it was created by the Windows 10 OpenSSH optional feature).

If you delete the old service and try again, it should work.

You can delete the service with sc, for example: sc.exe delete sshd.

Sunil Patel

Posted 2016-07-28T12:46:39.577

Reputation: 126

0

Please note that the CYGWIN settings you are using are obsolete, see:

https://cygwin.com/cygwin-ug-net/using-cygwinenv.html

So likely almost all the tutorial. About

Should StrictModes be used? (yes/no)

The default is Yes so don't use different value.

matzeri

Posted 2016-07-28T12:46:39.577

Reputation: 1 662

Same problem still exists when I say yes to Should StrictModes be used? (yes/no) – Barry Michael Doyle – 2016-07-28T23:51:45.763

1please provide the output of $ /usr/bin/cygrunsrv -VQ sshd .You can also follow https://cygwin.com/problems.html and ship there the cygcheck.out – matzeri – 2016-07-29T04:41:26.943

Nevermind, I'm sorry it did actually work, thanks man you're a life saver! – Barry Michael Doyle – 2016-07-29T08:16:17.437