This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: I can't connect to ssh
- From: Marilo <narium85-mlscar at yahoo dot co dot uk>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Sun, 7 Jun 2015 13:16:53 +0000 (UTC)
- Subject: Re: I can't connect to ssh
- Authentication-results: sourceware.org; auth=none
- Reply-to: Marilo <narium85-mlscar at yahoo dot co dot uk>
On Sunday, 7 June 2015, 3:48, Jim Garrison <jhg@jhmg.net> wrote:
On 6/6/2015 6:15 PM, Marilo wrote:
>>
>>
>> harvey@samsung350 ~
>> $ nc 127.0.0.1 22
>> SSH-2.0-OpenSSH_6.6.1
>>
>>
>> harvey@samsung350 ~
>> $ ssh 127.0.0.1
>> Connection closed by 127.0.0.1
>>
>>
>> I have no authorized_keys file which is fine. I am allowing PasswordAuthentication and also PubKeyAuthentication on the server.
>> My password is not empty.
>>
>> It is not prompting me for any password. It just straight away says "connection closed by 127.0.0.1"
>>
>> I don't have any other computers on the network that I can try from at the moment.
[snip]
>Check the permissions on the public key file and authorized_keys in
>~/.ssh (and the .ssh directory itself). If the target were Linux you
>could also look in /var/log/secure to see why the remote closed the
>connection. On a cygwin remote system I don't know where the log is
>located, but somebody else on the list can probably tell you.
Below I have checked all of those i'm not sure if the owner is necessarily ok but the rest seems definitely ok.
harvey@samsung350 /var
$ ls -l /var/log/sshd.log
-rw-r--r-- 1 SYSTEM root 4489 May 13 03:41 /var/log/sshd.log
So it hasn't been written to recently
harvey@samsung350 /var
$ tail -n 1 /var/log/sshd.log
/var/empty must be owned by root and not group or world-writable.
ok that's an old error
harvey@samsung350 /var
$ ls -ld /var/empty
drwxr-xr-x+ 1 SYSTEM root 0 Aug 29 2014 /var/empty
permissions are fine I guess. I'm not sure if owner should say root.
Permissions for ~/.ssh and its contents is absolutely correct. I have no ~/.ssh/authorized_keys file though that's ok not to have that.
harvey@samsung350 /var
$ ls -ld ~/.ssh
drwx------+ 1 harvey None 0 Jun 7 01:38 /home/harvey/.ssh
harvey@samsung350 /var
$ ls -l ~/.ssh
total 19
-rw------- 1 harvey None 1679 Aug 29 2014 id_rsa
-rw------- 1 harvey None 399 Aug 29 2014 id_rsa.pub
-rw------- 1 harvey None 1679 Sep 4 2014 id2_rsa
-rw-r--r-- 1 harvey None 870 Jun 6 23:07 known_hosts
-rw-r--r-- 1 harvey None 361 Sep 5 2014 known_hosts.bak
-rw-r--r-- 1 harvey None 867 Sep 8 2014 known_hostsb
-rw-r--r-- 1 harvey None 38 May 21 06:47 oldconfig
harvey@samsung350 /var
$
I guess my server keys permissions are ok. I'm not sure if owner should be root
harvey@samsung350 /etc
$ ls -l ssh_*
-rw-rwxr-- 1 SYSTEM root 1574 Jun 7 01:35 ssh_config
-rw------- 1 SYSTEM root 668 Aug 29 2014 ssh_host_dsa_key
-rw-r--r-- 1 SYSTEM root 607 Aug 29 2014 ssh_host_dsa_key.pub
-rw------- 1 SYSTEM root 227 Aug 29 2014 ssh_host_ecdsa_key
-rw-r--r-- 1 SYSTEM root 179 Aug 29 2014 ssh_host_ecdsa_key.pub
-rw------- 1 SYSTEM root 411 Aug 29 2014 ssh_host_ed25519_key
-rw-r--r-- 1 SYSTEM root 99 Aug 29 2014 ssh_host_ed25519_key.pub
-rw------- 1 SYSTEM root 982 Aug 29 2014 ssh_host_key
-rw-r--r-- 1 SYSTEM root 647 Aug 29 2014 ssh_host_key.pub
-rw------- 1 SYSTEM root 1675 Aug 29 2014 ssh_host_rsa_key
-rw-r--r-- 1 SYSTEM root 399 Aug 29 2014 ssh_host_rsa_key.pub
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple