install sshd using cygwin
Asked Answered
F

2

5

I want to use cygwin to install sshd in windows. But when I start the sshd service, it says:

The CYGWIN sshd service is starting.
The CYGWIN sshd service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.

And the sshd.log says:

Permissions 0660 for '/etc/ssh_host_dsa_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh_host_dsa_key
Could not load host key: /etc/ssh_host_dsa_key

So how to deal with it?

Frogfish answered 23/11, 2012 at 10:43 Comment(0)
M
3

You need to make sure only the cyg_server user can access those keys.

chown cyg_server /etc/ssh*
chmod 600 /etc/ssh*

Those commands do just that, and will allow your sshd to run correctly.

Mawson answered 8/3, 2013 at 21:22 Comment(4)
I am not sure how to access the sshd.log file (cat /var/log/sshd.log returns blank, even my ls returns blank?), but I applied the two commands you stated and still cannot connect. Any idea?Georgena
Ok if I print /var/log/sshd.log it returns the following: Unable to initialize device PRN .Georgena
Hopefully someone else can be more helpful... It took a lot of effort to actually get this going, and I only managed on one install of W7. Are you following a guide to set this up?Mawson
Yep first I followed a Youtube video and then started on two blogs after that didn't work. My computer is a bit old; I start a new job Monday and will retry when they supply me with a new PC.Georgena
D
4

My /var/log/sshd.log had this in the end:

Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
/var/empty must be owned by root and not group or world-writable.
/var/empty must be owned by root and not group or world-writable.
/var/empty must be owned by root and not group or world-writable.
/var/empty must be owned by root and not group or world-writable.

Looking at /var i saw this:

$ ls /var -All
total 0
drwxrwxr-x+ 1 xxxx       None 0 Dec  8 15:59 cache
drwxrwxr-x+ 1 cyg_server root 0 Dec  8 16:21 empty
drwxrwxr-x+ 1 xxxx       None 0 Dec  8 15:58 lib
drwxrwxrwx+ 1 xxxx       None 0 Dec  8 16:27 log
drwxrwxrwx+ 1 xxxx       None 0 Dec  8 15:48 run
drwxrwxrwt+ 1 xxxx       None 0 Dec  8 15:48 tmp

So i just did chmod 600 /var/empty and that fixed it!

Deceive answered 9/12, 2013 at 14:48 Comment(0)
M
3

You need to make sure only the cyg_server user can access those keys.

chown cyg_server /etc/ssh*
chmod 600 /etc/ssh*

Those commands do just that, and will allow your sshd to run correctly.

Mawson answered 8/3, 2013 at 21:22 Comment(4)
I am not sure how to access the sshd.log file (cat /var/log/sshd.log returns blank, even my ls returns blank?), but I applied the two commands you stated and still cannot connect. Any idea?Georgena
Ok if I print /var/log/sshd.log it returns the following: Unable to initialize device PRN .Georgena
Hopefully someone else can be more helpful... It took a lot of effort to actually get this going, and I only managed on one install of W7. Are you following a guide to set this up?Mawson
Yep first I followed a Youtube video and then started on two blogs after that didn't work. My computer is a bit old; I start a new job Monday and will retry when they supply me with a new PC.Georgena

© 2022 - 2024 — McMap. All rights reserved.