Connection closed :: 1 error in cygwin

I am trying to make an ssh connection using cygwin. I follow the instructions given here . When I run the ssh localhost command, I get a Connection closed by ::1 error. Since I'm new to unix and cygwin, I can't figure out what went wrong. Please tell me why this error occurs and how to resolve it.

My cygwin shell looks like this:

 $ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/Shekhar/.ssh/id_rsa): /home/Shekhar/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/Shekhar/.ssh/id_rsa. Your public key has been saved in /home/Shekhar/.ssh/id_rsa.pub. The key fingerprint is: 85:69:77:cc:fd:21:8a:ce:fe:46:41:ee:c8:e7:3d:7b Shekhar@Shekhar-PC The key randomart image is: +--[ RSA 2048]----+ | | | o + . | | + = +... | | . o.+. ...| | So. .| | oo + | | o+ . | | . oo E | | .o. .+ | +-----------------+ Shekhar@Shekhar-PC ~ $ cd ~/.ssh/ Shekhar@Shekhar-PC ~/.ssh $ ls -l total 10 -rw-r--r-- 1 Shekhar None 1200 Jun 16 19:49 authorized_keys -rw------- 1 Shekhar None 1675 Jun 20 08:55 id_rsa -rw-r--r-- 1 Shekhar None 400 Jun 20 08:55 id_rsa.pub -rw-r--r-- 1 Shekhar None 171 Jun 6 23:28 known_hosts Shekhar@Shekhar-PC ~/.ssh $ cat id_rsa.pub >> authorized_keys Shekhar@Shekhar-PC ~/.ssh $ ssh localhost Connection closed by ::1 
+4
source share
4 answers

My problem is resolved. I just uninstalled cygwin and installed it again, and somehow it worked correctly.

-4
source

I had the same problem. The problem for me, at least, was to create the cyg_server user using ssh-host-config. It was created without a home directory and with its shell set to / bin / false. So, I changed the / etc / passwd file for the cyg_server user to map / home / cyg _server (changed from / var / empty) and / bin / false to / bin / bash and created the home directory for the user. Tried to reconnect using user cyg_server and voila.

:

 mkdir /home/cyg_server vim /etc/passwd cyg_server:...(bunch of stuff)...:/var/empty:/bin/false 

to

 cyg_server:...(bunch of stuff)...:/home/cyg_server:/bin/bash 

Presumably, cygwin has a usermod command or a synonym that will make this a bit more secure. But I was impatient, and that is what I did. If anyone follows this, pay attention to be extremely careful when editing the / etc / passwd file.

+5
source

Just in case, others find the same problem. Since you selected cyg_server as the username when configuring ssh, try connecting using the ssh cyg_server @localhost command rather than the default ssh localhost. Password may be the same as during setup

+3
source

Put it here if someone comes across this later. I had the same problem and reinstalling cygwin solved it ... until I rebooted. Then I got the same error again. Now I solved the problem a second time: instead of using the account name "cyg_server" that cygwin offers me when running ssh-host-config, I entered the name of my regular administrator account in Windows. Seems to work so far.

+2
source

All Articles