Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

getting ssh_exchane_identity error when trying to login from my machine or a remote one. Already enabled remote login

I updated my system from Snow Leopard to Lion 7.3.1

Wanted to login from remote computer and then enabled the remote login in Preferences/Sharing, but when trying to login I get the error ssh_exchange_identification also if I try to login from my machine with ssh username@localhost.

I tried all what I could find on internet forums, but nothing changed.

Please help!!

Daniela

MacBook Air (Mid 2009), Mac OS X (10.6.8), want to install Lion

Posted on May 22, 2012 7:04 PM

Reply
Question marked as Best reply

Posted on May 22, 2012 7:48 PM

Please post the output of


ssh -vvv localhost


on the server. Also post the log messages from sshd.

7 replies

May 22, 2012 8:05 PM in response to Linc Davis

Hi Linc

here is the output of ssh -vvv localhost


OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011

debug1: Reading configuration data /etc/ssh_config

debug1: Applying options for *

debug2: ssh_connect: needpriv 0

debug1: Connecting to localhost [::1] port 22.

debug1: Connection established.

debug3: Not a RSA1 key file /Users/danielamaurizio/.ssh/id_rsa.

debug2: key_type_from_name: unknown key type '-----BEGIN'

debug3: key_read: missing keytype

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug3: key_read: missing whitespace

debug2: key_type_from_name: unknown key type '-----END'

debug3: key_read: missing keytype

debug1: identity file /Users/danielamaurizio/.ssh/id_rsa type 1

debug1: identity file /Users/danielamaurizio/.ssh/id_rsa-cert type -1

debug1: identity file /Users/danielamaurizio/.ssh/id_dsa type -1

debug1: identity file /Users/danielamaurizio/.ssh/id_dsa-cert type -1

ssh_exchange_identification: Connection closed by remote host

[1]+ Done edit sshd_config


The following line comes from /var/log/secure.log

May 23 04:59:46 <danielamaurizio> sshd[2267]: fatal: /var/empty must be owned by root and not group or world-writable.


but I'm not sure if it's want you asked me; the owner of /var/empty is root of group sys.

By the way I had a problem that Lion cancelled the owner root and I had to use System Preferences User and groups to add root again, with the result that now I can use only the comman "su root" and not "sudo anycommand" anymore.

Thanks for halp and cheers

daniela

May 22, 2012 8:54 PM in response to danimauri

I had a problem that Lion cancelled the owner root and I had to use System Preferences User and groups to add root again, with the result that now I can use only the comman "su root" and not "sudo anycommand" anymore.


You probably have a corrupt user database.


Back up all data. Delete the file


/var/db/.AppleSetupDone


Reboot. You'll boot into Setup Assistant, as if you had just installed Lion on an empty drive. Recreate your admin account with the same name and password. Then finish booting and recreate your other users, if any.

May 24, 2012 8:06 AM in response to Linc Davis

Hi Linc

sorry I didn't write before but I had internet line problems.

Following your suggestion of your second post,I couldn't recreate a root account (the setup assistant didn't let me do it), only another user account and it didn't solve the problem. From the report you asked me I realized that it could have been a permission problem. The Apple Disk Utility showed that almost all the apple files had wrong permissions, so I asked a permission repair and this solved both mentioned problems. The mystery is: how and when this happened on my disk? I'm not conscious of any action I did to get that mess!!

Anyway thanks for the first suggestion.

Cheers

getting ssh_exchane_identity error when trying to login from my machine or a remote one. Already enabled remote login

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.