Unable to start cygwin sshd service

后端 未结 5 409
终归单人心
终归单人心 2021-02-01 16:55

I entered ssh-host-config into the cygwin prompt (started with admin privileges), said yes to privilege separation, new local account sshd, install sshd as a servic

相关标签:
5条回答
  • 2021-02-01 17:33

    I tried above solutions but nothing worked for me. I am using Windows 8 and was able to solve it. My sshd.log file says : "Privilege separation user sshd does not exist FAILED"

    So to remove this error while starting sshd as service just following below steps:

    1. Edit the file /etc/passwd --
      add " sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin ".

    2. Edit the file /etc/group -- add " sshd:x:74: ".

    Now start service as net start sshd

    It worked for me!

    0 讨论(0)
  • 2021-02-01 17:36

    In my case (using a Polish version of Windows 8) I had to manually modify the /etc/passwd and /etc/group files.

    Some lines for Administrator, Administrators, Guest, Guests, etc. had been missing, so I merely inserted them, and copied all other fields from their non-English versions. Eg.

    nano   /etc/passwd
    
    SYSTEM:*:18:544:,S-1-5-18::
    LocalService:*:19:544:U-NT AUTHORITY\LocalService,S-1-5-19::
    NetworkService:*:20:544:U-NT AUTHORITY\NetworkService,S-1-5-20::
    Administrators:*:544:544:,S-1-5-32-544::
    Administratorzy:*:544:544:,S-1-5-32-544::
    TrustedInstaller:*:4294967294:4294967294:U-NT SERVICE\TrustedInstaller,S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464::
    Administrator:unused:500:513:U-gordito\Administrator,S-1-5-21-580982140-4090956935-1935414389-500:/home/Administrator:/bin/bash
    Guest:unused:501:513:U-gordito\Gość,S-1-5-21-580982140-4090956935-1935414389-501:/home/Gość:/bin/bash
    Gość:unused:501:513:U-gordito\Gość,S-1-5-21-580982140-4090956935-1935414389-501:/home/Gość:/bin/bash
    HomeGroupUser$:unused:1004:513:HomeGroupUser$,U-gordito\HomeGroupUser$,S-1-5-21-580982140-4090956935-1935414389-1004:/home/HomeGroupUser$:/bin/bash
    sshd:unused:1006:513:sshd privsep,U-gordito\sshd,S-1-5-21-580982140-4090956935-1935414389-1006:/var/empty:/bin/false
    cyg_server:unused:1007:513:Privileged server,U-gordito\cyg_server,S-1-5-21-580982140-4090956935-1935414389-1007:/var/empty:/bin/false
    
    
    nano /etc/group
    
    root:S-1-5-32-544:0:
    SYSTEM:S-1-5-18:18:
    TrustedInstaller:S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464:4294967294:
    Administrators:S-1-5-32-544:544:
    Administratorzy:S-1-5-32-544:544:
    Czytelnicy dzienników zdarzeń:S-1-5-32-573:573:
    Guests:S-1-5-32-546:546:
    Goście:S-1-5-32-546:546:
    IIS_IUSRS:S-1-5-32-568:568:
    Users:S-1-5-32-545:545:
    Users DCOM:S-1-5-32-562:562:
    Użytkownicy:S-1-5-32-545:545:
    Użytkownicy DCOM:S-1-5-32-562:562:
    Użytkownicy dzienników wydajności:S-1-5-32-559:559:
    Użytkownicy monitora wydajności:S-1-5-32-558:558:
    Użytkownicy zarządzania zdalnego:S-1-5-32-580:580:
    HomeUsers:S-1-5-21-580982140-4090956935-1935414389-1003:1003:
    TelnetClients:S-1-5-21-580982140-4090956935-1935414389-1005:1005:
    WinRMRemoteWMIUsers__:S-1-5-21-580982140-4090956935-1935414389-1000:1000:
    None:S-1-5-21-580982140-4090956935-1935414389-513:513:
    Brak:S-1-5-21-580982140-4090956935-1935414389-513:513:
    

    Only after this, I was finally able to chmod g-rwx all the files that offended sshd, in a way that 'ls -la' indeed confirmed the dropped permissions for group and other.

    Then finally, privileged CYGWIN services installed and started (sshd, cron)

    0 讨论(0)
  • 2021-02-01 17:42

    I had the same problem and here is the solution that worked for me.

    Solution 1

    Restart the machine after you set the path environment variables to point to Cygwin bin directories and then start the service.

    Solution 2

    1. First add the account that runs the Cygwin sshd demon service to administrators group (this is by default)

    2. Go to your cygwin installation folder (mine is at c:\cygwin64 and yours may differ)

      • add administrators group as full control. remove the property
      • Remove Readonly for your cygwin installation folder so anyone can write into it
    3. Run the cygwin terminal as administrator and remove the service by typing

      cygrunsrv -R sshd
      
    4. Reboot your system

    5. Run the cygwin terminal as administrator and reinstall the service again by typing

      ssh-host-config -y
      
    6. Run the cygwin terminal as administrator and start the service by typing

      net start sshd
      

    Your service now be running!

    0 讨论(0)
  • 2021-02-01 17:48

    I followed the steps in this topic and the problem was still happening, then I checked the sshd log file and it was complaining that the privilegies of the ssh private key were to open.

    I executed the follow command:

    chmod 400 /etc/ssh_host_ecdsa_key
    

    Then I run the service:

    net start sshd
    

    It finally worked (BTW: I am using Windows 8)

    0 讨论(0)
  • 2021-02-01 17:48

    Followed the steps provide by Andrea Solution 1 and solution 2 , it did not work. Event viewer did not provide any info.

    So took a look at the log var/log/sshd.log first it complained that it was unable to load the dll:

    /usr/sbin/sshd.exe: error while loading shared libraries: cygcrypto-1.0.0.dll
    

    Solution:

    • Reinstalled the package and ensured that the dll were in lib.
    • Started the service again still it failed but this time it complained about missing host key.

      Could not load host key: /etc/ssh_host_dsa_key Could not load host key: /etc/ssh_host_ecdsa_key Disabling protocol version 2. Could not load host key sshd: no hostkeys available -- exiting.

    Solution:

    • go to the Cygwin Command prompt (with run as admin ) and
    • enter ssh-keygen -A
      the missing host key were generated .

    Finally I was able to start it.

    I would recommend looking at the log file further if the above solution does not work.

    0 讨论(0)
提交回复
热议问题