Discussion:
Cannot run SSH
baykusderki
2009-11-22 01:32:35 UTC
Permalink
Hello,

In the past I have managed to install Cygwin and SSH on multiple
computers. All of them are running fine and serving SSH just fine. So I
am not that new to installing this stuff.

At the moment I am trying to run SSH on my Windows7 64. I know it is not
tested and maybe not supposed to work at the moment. I actually
installed and ran SSH successfully on this machine couple days ago when
I have first installed Windows7. Yesterday it has stopped working so
without any given reason. The only thing I can remember that might
affect things is downloading the latest whatever version of cygwin
setup.exe that was on Cygwin site yesterday. I did install couple apps
like xemacs, command line task-todo app and I think I have upgraded the
Openssh to the latest version. Up until that moment, the Ssh server was
running alright. I am not sure if anything else has been updated during
the installation. I tried "ssh-host-config -y", it did not resolve
anything for me. I did fire "rm -R etc/ssh*", deleted the service and
the users, started over. It did not lead to any success. I have actually
deleted my "cygwin" folder since it was a new installation I just did
not care about it, just to start fresh. After the fresh install I fired
"ssh-host-config -y" in the commandline. It installed everything without
a glitch but Ssh was not running successfully. Just to see if it would
work on any other win7 installation, I did install windows7(32bit
version) on a virtual machine(virtual box) and I installed the same
Cygwin setup. This time without much itching the Ssh server started and
worked well. So I am really not sure about what to make of this situation.

I have Windows Defender disabled and I do not run any virus-firewall
application at the moment.

The sshd.log file under /var/log/ is empty(0 kb)


Here are some error messages

"$ net start sshd
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.
"
$ cygrunsrv.exe -S sshd
cygrunsrv: Error starting a service: QueryServiceStatus: Win32 error 1062:
The service has not been started.
"

Here is the cygcheck
"
$ cygcheck /usr/sbin/sshd
C:\cygwinx\usr\sbin\sshd.exe
C:\cygwinx\bin\cygcrypt-0.dll
C:\cygwinx\bin\cygwin1.dll
C:\Windows\system32\ADVAPI32.DLL
C:\Windows\system32\msvcrt.dll
C:\Windows\system32\KERNELBASE.dll
C:\Windows\system32\ntdll.dll
C:\Windows\system32\API-MS-Win-Core-Console-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-DateTime-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Debug-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-ErrorHandling-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Fibers-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-File-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Handle-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Heap-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Interlocked-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Localization-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-LibraryLoader-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Memory-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Misc-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-NamedPipe-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-ProcessThreads-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Profile-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-String-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Synch-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-SysInfo-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-Util-L1-1-0.dll
C:\Windows\system32\API-MS-WIN-Service-Core-L1-1-0.dll
C:\Windows\system32\API-MS-WIN-Service-winsvc-L1-1-0.dll
C:\Windows\system32\API-MS-WIN-Service-Management-L1-1-0.dll
C:\Windows\system32\API-MS-WIN-Service-Management-L2-1-0.dll
C:\Windows\system32\API-MS-Win-Core-LocalRegistry-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Security-Base-L1-1-0.dll
C:\Windows\system32\KERNEL32.dll
C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-IO-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Core-ThreadPool-L1-1-0.dll
C:\Windows\system32\RPCRT4.dll
C:\Windows\system32\SspiCli.dll
C:\Windows\system32\CRYPTBASE.dll
C:\Windows\system32\API-MS-Win-Core-DelayLoad-L1-1-0.dll
C:\Windows\system32\API-MS-Win-Security-LSALookup-L1-1-0.dll
C:\cygwinx\bin\cygcrypto-0.9.8.dll
C:\cygwinx\bin\cyggcc_s-1.dll
C:\cygwinx\bin\cygwrap-0.dll
C:\cygwinx\bin\cygz.dll

"

I would appreciate any lead on this issue.


thanks
Huang Bambo
2009-11-22 03:29:00 UTC
Permalink
run /usr/sbin/sshd directly and check if it can start.
Post by baykusderki
Hello,
In the past I have managed to install Cygwin and SSH on multiple computers.
All of them are running fine and serving SSH just fine. So I am not that new
to installing this stuff.
At the moment I am trying to run SSH on my Windows7 64. I know it is not
tested and maybe not supposed to work at the moment. I actually installed
and ran SSH successfully on this machine couple days ago when I have first
installed Windows7. Yesterday it has stopped working so without any given
reason.  The only thing I can remember that might affect things is
downloading the latest whatever version of cygwin setup.exe that was on
Cygwin site yesterday. I did install couple apps like xemacs, command line
task-todo app and I think I have upgraded the Openssh to the latest version.
Up until that moment, the Ssh server was running alright.  I am not sure if
anything else has been updated during the installation.   I tried
"ssh-host-config -y", it did not resolve anything for me. I did fire "rm  -R
etc/ssh*", deleted the service and the users, started over. It did not lead
to any success. I have actually deleted my "cygwin" folder since it was a
new installation I just did not care about it, just to start fresh. After
the fresh install I fired "ssh-host-config -y" in the commandline. It
installed everything without a glitch but Ssh was not running successfully.
 Just to see if it would work on any other win7 installation, I did install
windows7(32bit version) on a virtual machine(virtual box) and I installed
the same Cygwin setup. This time without much itching the Ssh server started
and worked well. So I am really not sure about what to make of this
situation.
I have Windows Defender disabled and I do not run any virus-firewall
application at the moment.
The sshd.log  file under /var/log/ is empty(0 kb)
Here are some error messages
"$ net start sshd
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.
"
$ cygrunsrv.exe -S sshd
The service has not been started.
"
Here is the cygcheck
"
$ cygcheck /usr/sbin/sshd
C:\cygwinx\usr\sbin\sshd.exe
 C:\cygwinx\bin\cygcrypt-0.dll
   C:\cygwinx\bin\cygwin1.dll
     C:\Windows\system32\ADVAPI32.DLL
       C:\Windows\system32\msvcrt.dll
         C:\Windows\system32\KERNELBASE.dll
           C:\Windows\system32\ntdll.dll
         C:\Windows\system32\API-MS-Win-Core-Console-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-DateTime-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Debug-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-ErrorHandling-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Fibers-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-File-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Handle-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Heap-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Interlocked-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Localization-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-LibraryLoader-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Memory-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Misc-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-NamedPipe-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-ProcessThreads-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Profile-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-String-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Synch-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-SysInfo-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-Util-L1-1-0.dll
       C:\Windows\system32\API-MS-WIN-Service-Core-L1-1-0.dll
       C:\Windows\system32\API-MS-WIN-Service-winsvc-L1-1-0.dll
       C:\Windows\system32\API-MS-WIN-Service-Management-L1-1-0.dll
       C:\Windows\system32\API-MS-WIN-Service-Management-L2-1-0.dll
       C:\Windows\system32\API-MS-Win-Core-LocalRegistry-L1-1-0.dll
       C:\Windows\system32\API-MS-Win-Security-Base-L1-1-0.dll
       C:\Windows\system32\KERNEL32.dll
         C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-IO-L1-1-0.dll
         C:\Windows\system32\API-MS-Win-Core-ThreadPool-L1-1-0.dll
       C:\Windows\system32\RPCRT4.dll
         C:\Windows\system32\SspiCli.dll
           C:\Windows\system32\CRYPTBASE.dll
             C:\Windows\system32\API-MS-Win-Core-DelayLoad-L1-1-0.dll
           C:\Windows\system32\API-MS-Win-Security-LSALookup-L1-1-0.dll
 C:\cygwinx\bin\cygcrypto-0.9.8.dll
   C:\cygwinx\bin\cyggcc_s-1.dll
 C:\cygwinx\bin\cygwrap-0.dll
 C:\cygwinx\bin\cygz.dll
"
I would appreciate any lead on this issue.
thanks
--
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
Eric Blake
2009-11-22 03:33:46 UTC
Permalink
Post by Huang Bambo
run /usr/sbin/sshd directly and check if it can start.
^^^^

121 lines of email, with only one line of new content, and on the wrong
side. PLEASE learn how to avoid http://cygwin.com/acronyms/#TOFU, and
quit quoting raw email addresses: http://cygwin.com/acronyms/#PCYMTNQREAIYR

- --
Don't work too hard, make some time for fun as well!

Eric Blake ***@byu.net
Larry Hall (Cygwin)
2009-11-23 01:36:32 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Huang Bambo
run /usr/sbin/sshd directly and check if it can start.
^^^^
121 lines of email, with only one line of new content, and on the wrong
side. PLEASE learn how to avoid http://cygwin.com/acronyms/#TOFU, and
quit quoting raw email addresses: http://cygwin.com/acronyms/#PCYMTNQREAIYR
All true and a very good point. But even more important is the advice will
certainly keep 'sshd' from running as a daemon now. I understand why people
try this and why they recommend it but I really wish there was a way we could
keep people who don't understand the differences of switching users on Windows
compared to Linux from giving out advice like this...
--
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
216 Dalton Rd. (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
Q: Are you sure?
Post by Huang Bambo
A: Because it reverses the logical flow of conversation.
Q: Why is top posting annoying in email?
baykusderki
2009-11-22 03:43:51 UTC
Permalink
Post by Huang Bambo
run /usr/sbin/sshd directly and check if it can start.
Hi
This is what I get
"
$ /usr/sbin/sshd
/var/empty must be owned by root and not group or world-writable.
"

And this is what I have

"$ ls -al /var
drwxr-xr-x+ 1 masayeni Administrators 0 2009-11-21 21:36 .
drwxr-xr-x+ 1 masayeni Administrators 4096 2009-11-21 21:17 ..
drwxr-xr-x+ 1 masayeni Administrators 0 2009-11-21 21:15 cache
drwxr-xr-x+ 1 cyg_server Administrators 0 2009-11-21 21:36 empty
drwxr-xr-x+ 1 masayeni Administrators 0 2009-11-21 21:14 lib
drwxrwxrwx+ 1 masayeni Administrators 0 2009-11-21 21:36 log
drwxrwxrwx+ 1 masayeni Administrators 0 2009-11-21 21:14 run
drwxrwxrwt+ 1 masayeni Administrators 0 2009-11-21 21:14 tmp
"
Ken Jackson
2009-11-22 05:24:36 UTC
Permalink
Post by baykusderki
Post by Huang Bambo
run /usr/sbin/sshd directly and check if it can start.
Hi
This is what I get
"
$ /usr/sbin/sshd
/var/empty must be owned by root and not group or world-writable.
"
OK, try this:

chown root:root /var/empty

Although, mine is owned by SYSTEM, so if that doesn't work, try:

chown SYSTEM:root /var/empty
baykusderki
2009-11-22 05:48:39 UTC
Permalink
Post by Ken Jackson
chown root:root /var/empty
chown SYSTEM:root /var/empty
I tried both and got errors. it complained that there was no such user
or group named root. So i tried "chown SYSTEM /var/empty" and it did not
work. The only time it(/usr/sbin/sshd) does not complain about the
folder rights is when I just delete the "empty" folder and create "mkdir
/var/empty" , straight with my admin account in the command line. The
sshd starts ok by firing /usr/bin/sshd. It seems to be listed in the
task list but none of the service running commands work, neither trying
to run it from the Windows service panel. I can login as "ssh
localhost", but none of the other defined users or networked computers
can connect to it. The passwd file lists these users properly as far as
I can tell.

here I am trying to login to ssh the first time(test purpose). Normally
it is supposed to create the home folder and give me a ncie cozzy welcome.

"$ ssh ***@localhost
***@localhost's password:
Permission denied, please try again.
***@localhost's password:
Could not chdir to home directory /home/ubun: No such file or directory
/bin/bash: Permission denied
Connection to localhost closed.
"


thanks
Ken Jackson
2009-11-22 06:00:58 UTC
Permalink
Post by baykusderki
Post by Ken Jackson
chown root:root /var/empty
chown SYSTEM:root /var/empty
I tried both and got errors. it complained that there was no such
user or group named root. So i tried "chown SYSTEM /var/empty" and it
did not work.
...
Post by baykusderki
The passwd file lists these users properly as far as I can tell.
Is SYSTEM in /etc/passwd? If not, I think that's a problem. Even if
it's there, maybe it's wrong. I would try the mkpasswd command to
recreate your passwd file (and might as well mkgroup to recreate
the /etc/group file). They both write to stdout so you have to
redirect them:

mkpasswd > /etc/passwd
baykusderki
2009-11-22 06:29:03 UTC
Permalink
Post by Ken Jackson
Is SYSTEM in /etc/passwd? If not, I think that's a problem. Even if
it's there, maybe it's wrong. I would try the mkpasswd command to
recreate your passwd file (and might as well mkgroup to recreate
the /etc/group file). They both write to stdout so you have to
mkpasswd> /etc/passwd
--
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
Yep the SYSTEM is listed alright. I already created the passwd file
multiple times, before and after ssh installation. I do not know what
all those numbers in it but as far as I can see the users and their
default folders listed fine there. I can pretty much see all the defined
users including the ssh setup based users.

"mkpasswd -cl > /etc/passwd" was the command I have used multiple times.


The weird thing was that the Cygwin+Ssh installation on Win7 was the
easiest of all installations I had done before. It worked for couple
days and stopped yesterday. Something is funky and I cannot figure it
out after spending 10 hours on this. I am sure it is couple minutes fix
if you are an expert on this stuff but that is the best i can do on my own.
Alex Quinn
2009-11-23 19:48:39 UTC
Permalink
FWIW, I had the exact same problem. This was under Cygwin 1.5 (not 1.7) and Win7 (build 7600 enterprise release). The OpenSSH server worked for a few days and then stopped working with similar symptoms to you. I eventually got it working again. After working for a couple more days, it broke again. Nevertheless, this is what I did to make it work after not working. I realize some of this may be unnecessary or even counterproductive. I don't know enough Cygwin and/or Windows to say what made a difference so I'm just telling you what I did in the off chance that it helps somebody find the real problem.

1. Stop and delete the service:
cygrunsrv --stop sshd
cygrunsrv --remove sshd
2. Remove the cyg_server user via Windows.
3. Restart system.
4. From bash, run ssh-host-config to recreate user and sshd service. Answer yes to everything except allow cyg_server to be the name of the user.
5. Manually set the password for the cyg_server user from Cygwin. Make it 10 characters with only alphanumeric (i.e. "abcDEF1234" - not my password obviously).
passwd cygserver
6. Go into Services, properties of the sshd service, Log On tab. Manually set that to the stored log on password for the service.
7. Close bash if it's still open.
8. Start-->Run-->"ash" and run the rebaseall command.
9. From the command prompt, run net start sshd.

Please forgive the superfluous details. Good luck!

Alex






----- Original Message ----
From: baykusderki <***@gmail.com>
To: ***@cygwin.com
Sent: Sun, November 22, 2009 1:29:03 AM
Subject: Re: Cannot run SSH
Post by Ken Jackson
Is SYSTEM in /etc/passwd? If not, I think that's a problem. Even if
it's there, maybe it's wrong. I would try the mkpasswd command to
recreate your passwd file (and might as well mkgroup to recreate
the /etc/group file). They both write to stdout so you have to
mkpasswd> /etc/passwd
--
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
Yep the SYSTEM is listed alright. I already created the passwd file multiple times, before and after ssh installation. I do not know what all those numbers in it but as far as I can see the users and their default folders listed fine there. I can pretty much see all the defined users including the ssh setup based users.

"mkpasswd -cl > /etc/passwd" was the command I have used multiple times.


The weird thing was that the Cygwin+Ssh installation on Win7 was the easiest of all installations I had done before. It worked for couple days and stopped yesterday. Something is funky and I cannot figure it out after spending 10 hours on this. I am sure it is couple minutes fix if you are an expert on this stuff but that is the best i can do on my own.






--
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
baykusderki
2009-11-23 19:52:27 UTC
Permalink
Post by Alex Quinn
FWIW, I had the exact same problem. This was under Cygwin 1.5 (not 1.7) and Win7 (build 7600 enterprise release). The OpenSSH server worked for a few days and then stopped working with similar symptoms to you. I eventually got it working again. After working for a couple more days, it broke again. Nevertheless, this is what I did to make it work after not working. I realize some of this may be unnecessary or even counterproductive. I don't know enough Cygwin and/or Windows to say what made a difference so I'm just telling you what I did in the off chance that it helps somebody find the real problem.
cygrunsrv --stop sshd
cygrunsrv --remove sshd
2. Remove the cyg_server user via Windows.
3. Restart system.
4. From bash, run ssh-host-config to recreate user and sshd service. Answer yes to everything except allow cyg_server to be the name of the user.
5. Manually set the password for the cyg_server user from Cygwin. Make it 10 characters with only alphanumeric (i.e. "abcDEF1234" - not my password obviously).
passwd cygserver
6. Go into Services, properties of the sshd service, Log On tab. Manually set that to the stored log on password for the service.
7. Close bash if it's still open.
8. Start-->Run-->"ash" and run the rebaseall command.
9. From the command prompt, run net start sshd.
Please forgive the superfluous details. Good luck!
Alex
Hi

Thanks for the help offer, I desperately need it here :)


I actually have tried all those steps many times :( including rebasing.
But I will try these again in the order of steps you have provided. The
only thing I did not try was using alphanumeric password


thanks again

Loading...