1

Its getting stuck as you can see. Below is what verbose connection shows.

[ftpuser@eu9sacovn48 ~]$ ssh -v gmrsops@uscasaciccx82
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to uscasaciccx82 [113.130.154.54] port 22.
debug1: Connection established.
debug1: identity file /cpmapps/ftpuser/.ssh/identity type -1
debug1: identity file /cpmapps/ftpuser/.ssh/id_rsa type 1
debug1: identity file /cpmapps/ftpuser/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'uscasaciccx82' is known and matches the RSA host key.
debug1: Found key in /cpmapps/ftpuser/.ssh/known_hosts:7
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /cpmapps/ftpuser/.ssh/identity
debug1: Offering public key: /cpmapps/ftpuser/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8

I tried connecting to the server without a key but its still not working. [ftpuser@eu9sacovn48 ~]$ ssh -o PreferredAuthentications=keyboard-interactive,password -o PubkeyAuthentication=no gmrsops@USCASACICCX82 gmrsops@uscasaciccx82's password:

I can login to cygwin just fine while on local server.

local server

user2373210
  • 461
  • 2
  • 5
  • 16
  • What exactly do you mean when you say it's getting stuck? – McGlothlin Jul 06 '17 at 20:33
  • Its never shows the screen where it says that it is connected to the remote server. – user2373210 Jul 06 '17 at 20:59
  • Are you sure the ssh server is running? – McGlothlin Jul 06 '17 at 21:00
  • @McGlothlin: The debug output says that the public key authentication succeeded, so the server is likely running. – Jacobm001 Jul 07 '17 at 07:05
  • Latest cygwin ssh server is version 7.5p1. How updated is the cygwin machine ? Look also on ssh server application logs (usually on Event viewer, Windows log, Application, source=sshd) – matzeri Jul 07 '17 at 10:09
  • Does this answer your question? [Unable to start cygwin sshd service](https://stackoverflow.com/questions/17736096/unable-to-start-cygwin-sshd-service) – kenorb May 11 '20 at 22:54

2 Answers2

1

Here's what fixed the issue for me.

Run sshd in debug mode using below command

/usr/sbin/sshd.exe -D -dd

This gave me the below warnings

$ /usr/sbin/sshd.exe -D -dd debug2: load_server_config: filename /etc/sshd_config debug2: load_server_config: done config len = 285 debug2: parse_server_config: config /etc/sshd_config len 285 debug1: sshd version OpenSSH_7.5, OpenSSL 1.0.2k 26 Jan 2017 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0770 for '/etc/ssh_host_rsa_key' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. key_load_private: bad permissions Could not load host key: /etc/ssh_host_rsa_key @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0770 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. key_load_private: bad permissions Could not load host key: /etc/ssh_host_dsa_key @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0770 for '/etc/ssh_host_ecdsa_key' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. key_load_private: bad permissions Could not load host key: /etc/ssh_host_ecdsa_key @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0770 for '/etc/ssh_host_ed25519_key' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. key_load_private: bad permissions Could not load host key: /etc/ssh_host_ed25519_key sshd: no hostkeys available -- exiting.

So I changed the permissions of the above files to 600

$ chmod 0600 /etc/ssh_host*

Then the debug command again.

SHA256:4yqAb/GiMfMJPmIXfKz+Zw4fWOCVN7E6vUDHEtokdHk /var/empty must be owned by root and not group or world-writable.

Then change the permission of this folder to 600.

$ chmod 600 /var/empty

This fixed the issue.

user2373210
  • 461
  • 2
  • 5
  • 16
0

Since you're trying to connect to a Windows machine, you may not have an SSH server installed/enabled. Check to make sure SSH is installed and properly configured in your cygwin environment. It is part of the OpenSSH package. More info here.

Edit: See this post where someone had the exact same error.

McGlothlin
  • 2,059
  • 1
  • 15
  • 28
  • SSH server is installed fine as it was working fine 2 days ago. I checked the log and this is what its showing. I don't see a time stamp in the log but time stamp for the log file is from them time when I restarted cygwin. Could not load host key: /etc/ssh_host_ed25519_key Could not load host key: /etc/ssh_host_ed25519_key Could not load host key: /etc/ssh_host_ed25519_key Could not load host key: /etc/ssh_host_ed25519_key Could not load host key: /etc/ssh_host_ed25519_key Could not load host key: /etc/ssh_host_ed25519_key – user2373210 Jul 07 '17 at 18:15
  • Updated answer. Potentially more help found here: https://www.digitalocean.com/community/questions/ubuntu-sftp-ssh-access-work-but-got-error-could-not-load-host-key-in-log – McGlothlin Jul 07 '17 at 19:04