Cygwin Connection closed by ::1

9,506

Solution 1

Here are some possibilities to try :

  1. Try substituting 127.0.0.1 for localhost.
  2. Verify that the cyg_server user account has a valid home directory (create /home/cyg_server if required) and its shell is /bin/bash.
  3. Uninstall Cygwin completely, clean up its directories and environment variables, and reinstall. The password to use is the one you provide while configuring Cygwin.
  4. Try using your normal account instead of cyg_server that is suggested by the Cygwin installation.

I don't understand why your post is tagged "linux" when you are using Cygwin - it should in this case be "windows". In this case, have a look at this article : Running hadoop in Windows.

Solution 2

The cyg_server user is not intended for direct use.

Check your /etc/hosts file for correctness, check that it explicitly resolves localhost to 127.0.0.1.

If you don't need IPv6, deactivate it.

Share:
9,506
manurajhada
Author by

manurajhada

Updated on September 18, 2022

Comments

  • manurajhada
    manurajhada over 1 year

    During the installation of Hadoop I am trying to setup CYGWIN and ssh. Installed and ssh also started successfully and setup authorization key as instructed HERE but When I try to connect to the localhost using ssh it says..

    $ ssh -v localhost
    OpenSSH_6.2p1, OpenSSL 1.0.1e 11 Feb 2013
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to localhost [::1] port 22.
    debug1: Connection established.
    debug1: identity file /home/manu/.ssh/id_rsa type 1
    debug1: identity file /home/manu/.ssh/id_rsa-cert type -1
    debug1: identity file /home/manu/.ssh/id_dsa type -1
    debug1: identity file /home/manu/.ssh/id_dsa-cert type -1
    debug1: identity file /home/manu/.ssh/id_ecdsa type -1
    debug1: identity file /home/manu/.ssh/id_ecdsa-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.2
    debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
    debug1: match: OpenSSH_6.2 pat OpenSSH*
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client aes128-ctr [email protected] none
    debug1: kex: client->server aes128-ctr [email protected] none
    debug1: sending SSH2_MSG_KEX_ECDH_INIT
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: ECDSA ec:bb:51:bb:d4:74:8f:27:49:8c:ef:59:a6:2b:ab:59
    debug1: Host 'localhost' is known and matches the ECDSA host key.
    debug1: Found key in /home/manu/.ssh/known_hosts:1
    debug1: ssh_ecdsa_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: Roaming not allowed by server
    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: Offering RSA public key: /home/manu/.ssh/id_rsa
    Connection closed by ::1
    

    After lots of googling I tried ssh -v cyg_server@localhost but it promt for password which I don't know..

    $ ssh -v cyg_Server@localhost
    OpenSSH_6.2p1, OpenSSL 1.0.1e 11 Feb 2013
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to localhost [::1] port 22.
    debug1: Connection established.
    debug1: identity file /home/manu/.ssh/id_rsa type 1
    debug1: identity file /home/manu/.ssh/id_rsa-cert type -1
    debug1: identity file /home/manu/.ssh/id_dsa type -1
    debug1: identity file /home/manu/.ssh/id_dsa-cert type -1
    debug1: identity file /home/manu/.ssh/id_ecdsa type -1
    debug1: identity file /home/manu/.ssh/id_ecdsa-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.2
    debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
    debug1: match: OpenSSH_6.2 pat OpenSSH*
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client aes128-ctr [email protected] none
    debug1: kex: client->server aes128-ctr [email protected] none
    debug1: sending SSH2_MSG_KEX_ECDH_INIT
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: Server host key: ECDSA ec:bb:51:bb:d4:74:8f:27:49:8c:ef:59:a6:2b:ab:59
    debug1: Host 'localhost' is known and matches the ECDSA host key.
    debug1: Found key in /home/manu/.ssh/known_hosts:1
    debug1: ssh_ecdsa_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: Roaming not allowed by server
    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: Offering RSA public key: /home/manu/.ssh/id_rsa
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: Trying private key: /home/manu/.ssh/id_dsa
    debug1: Trying private key: /home/manu/.ssh/id_ecdsa
    debug1: Next authentication method: keyboard-interactive
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: Next authentication method: password
    cyg_Server@localhost's password:
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    Permission denied, please try again.
    cyg_Server@localhost's password:
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    Permission denied, please try again.
    cyg_Server@localhost's password:
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: No more authentication methods to try.
    Permission denied (publickey,password,keyboard-interactive).
    

    Can someone please help me to establish a successful authenticated ssh connection with localhost.. Either by password or by creating another user or skipping authentication step.. It would be great to me! Thanks.

    • killermist
      killermist about 11 years
      Was going to rephrase your title to question, but after reading the body, I'm confused as to what you're asking. Sounds like "Why can't I log into an SSH instance on Cygwin?" but the details befudddle me.
  • manurajhada
    manurajhada about 11 years
    you mean hosts.allow? M pasting the content of file here.. ALL : localhost 127.0.0.1/32 [::1]/128 [::ffff:127.0.0.1]/128 : allow ALL : PARANOID : deny sshd: ALL : allow
  • manurajhada
    manurajhada about 11 years
    Thanks for your consideration, Please let me know what change I need to do here.
  • dawud
    dawud about 11 years
    I meant /etc/hosts. The log you provided shows a connection being closed by ::1 (IPv6 localhost), I'm suggesting to use IPv4 instead.
  • manurajhada
    manurajhada about 11 years
    Okay, And how to do that (use IPv4 instead of IPv6) ?
  • dawud
    dawud about 11 years
    Check your interface configuration and deactivate IPv6. Also, ensure you are using IPv4 when resolving localhost (ping it, for example)