SSH error. Error installing a service: CreateService: Win32 error 1057

6,270

I followed the instructions in the answer in this thread.

Excerpt:

For Windows XP.
To remove Cygwin sshd in the cleanest possible way:

Disclaimer

cygrunsrv -E sshd

cygrunsrv -R sshd

delete the folder c:\cygwin and all its sub-folders

remove the Environment Variable CYGWIN

edit the Environment path accordingly

Start...Run... regedit and delete these two registry trees

"HKEY_CURRENT_USER_Software_Cygnus Solutions"

"HKEY_LOCAL_MACHINE_Software_Cygnus Solutions"

Go to Control Panel, Category View, Performance and Maintenance, Administrative Tools, Computer Management.
or click Start...Run...compmgmt.msc
delete the sshd user if it exists in the "System Tools" - "Local Users and Groups" - "Users" section.
EDIT: These steps were originally for XP, and you may need to re-install cygwin afterwards.

Did a clean re-install of cygwin

And now it's working.

Share:
6,270

Related videos on Youtube

somethingSomething
Author by

somethingSomething

myreddIT reddiWisdom is knowing that you are nothing, Love is knowing that you are everything and between the two your life moves. First time I was introduced to Linux was in 2007, it was Kubuntu and this person told me about the philosophy and I was told that you are not a real Linux user if you are not programming in Linux. I've been using Linux for everyday use since 2009. I started to use Linux for real in 2012. L'amour, la chaleur et la paix! ´ó ^ĸØ←←{}¬^²³»»»»»»»»»»»»»»»»»»»»»»»»»»»» P.S. Earth is for f * * K sake flat as a pancake, I kid you not The Best Flat Earth Documentary ...... If you want to know more goto ericdubay.com or find Eric Dubay on youtube(https://www.youtube.com/channel/UC0_CSKUIVVFlfocgezQEBDg/videos) Humans are in jail and everthing in our society is made to imprison us, but don't despair help is here and things are changing. We were seen as threats to the real world and illegal because we are 97% ape but what they didn't know is that we are 3% g o d l y watch this and see that this is not a human song, there are beings and higher entities everywhere:Grimes - Genesis. The world we live in is not a world, it's a highly advanced computer, the creators name is 42. There are many secrets hiding in movies. If you don't believe me then,↓↓↓↓ Watch this youtube song: (Grimes - We Appreciate Power) https://www.youtube.com/watch?v=gYG_4vJ4qNA When you listen to music, notice how the singer is talking to someone, it could be you he's talking to but there is also a being you should know about that all songs are referering to:↓↓↓↓↓↓↓ Watch and listen to this song; (Gwen Stefani - What You Waiting For) stupid boy, take a chance you st*** Check this website out, it's awsome: https://debgen.simplylinux.ch/

Updated on September 18, 2022

Comments

  • somethingSomething
    somethingSomething over 1 year

    ssh-host-config is not working, I get this error at creating sshd as a service. I'm running Windows 7 32 bit with cygwin installed.

    It was working at first, after installing cygwin. I did ssh-host-config a few times. I wanted to be sure to change the configuration of ssh and sshd so I uninstalled. Can't remember if there was an error. I used these instructions when uninstalling and reinstalling.

    I followed the instructions on this site and suspect that changing the permissions on those directory's messed up my system. Somewhere, can't remember where, I saw a error/warning message about ownership and that it would mess up things. Maybe it's a good tutorial I don't know.

    Here is the error:

    /usr/bin/cygrunsrv: Error installing a service: CreateService:  Win32 error 1057
    

    Here is ssh-host-config:

     ~
    $ ssh-host-config -y
    
    *** Query: Overwrite existing /etc/ssh_config file? (yes/no) yes
    *** Info: Creating default /etc/ssh_config file
    *** Query: Overwrite existing /etc/sshd_config file? (yes/no) yes
    *** Info: Creating default /etc/sshd_config file
    *** Info: Privilege separation is set to yes by default since OpenSSH 3.3.
    *** Info: However, this requires a non-privileged account called 'sshd'.
    *** Info: For more info on privilege separation read /usr/share/doc/openssh/README.privsep.
    *** Query: Should privilege separation be used? (yes/no) yes
    *** Warning: sshd is in /etc/passwd, but the
    *** Warning: local machine's SAM does not know about sshd.
    *** Warning: Perhaps sshd is a pre-existing domain account.
    *** Warning: Continuing, but check if this is ok.
    *** Info: Updating /etc/sshd_config file
    *** Query: Overwrite existing /etc/inetd.d/sshd-inetd file? (yes/no) yes
    *** Info: Creating default /etc/inetd.d/sshd-inetd file
    *** Info: Updated /etc/inetd.d/sshd-inetd
    
    *** Query: Do you want to install sshd as a service?
    *** Query: (Say "no" if it is already installed as a service) (yes/no) yes
    *** Query: Enter the value of CYGWIN for the daemon: []
    *** Info: On Windows Server 2003, Windows Vista, and above, the
    *** Info: SYSTEM account cannot setuid to other users -- a capability
    *** Info: sshd requires.  You need to have or to create a privileged
    *** Info: account.  This script will help you do so.
    
    *** Warning: cyg_server is in /etc/passwd, but the local
    *** Warning: machine's SAM does not know about cyg_server.
    *** Warning: Perhaps cyg_server is a pre-existing domain account.
    *** Warning: Continuing, but check if this is ok.
    *** Info: You appear to be running Windows XP 64bit, Windows 2003 Server,
    *** Info: or later.  On these systems, it's not possible to use the LocalSystem
    *** Info: account for services that can change the user id without an
    *** Info: explicit password (such as passwordless logins [e.g. public key
    *** Info: authentication] via sshd).
    
    *** Info: If you want to enable that functionality, it's required to create
    *** Info: a new account with special privileges (unless a similar account
    *** Info: already exists). This account is then used to run these special
    *** Info: servers.
    
    *** Info: Note that creating a new user requires that the current account
    *** Info: have Administrator privileges itself.
    
    *** Info: The following privileged accounts were found: 'cyg_server' .
    
    *** Info: This script plans to use 'cyg_server'.
    *** Info: 'cyg_server' will only be used by registered services.
    *** Query: Please enter the password for user 'cyg_server':
    *** Query: Reenter:
    *** Query: Please enter the password for user 'cyg_server':
    *** Query: Reenter:
    
    /usr/bin/cygrunsrv: Error installing a service: CreateService:  Win32 error 1057:
    The account name is invalid or does not exist, or the password is invalid for the account name specified.
    
    *** ERROR: Installing sshd as a service failed!
    
    *** 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 tried to re-install openssh and cygrunsrv that doesn't help, still get the error.

    How do I delete all config files for ssh, sshd and cygrunsrv? How can I get ssh to install sshd as a sevice? Any ideas? Thank's Kristjan