user3400708
user3400708

Reputation: 21

Can't ssh into my mac through local host or remote machine

I've been researching this for days but can find the answer. I can't ssh into my mac neither from localhost or from another machine. Here is the ssh user@localhost -vvv output:

OpenSSH_5.6p1, OpenSSL 0.9.8y 5 Feb 2013    
debug1: Reading configuration data /etc/ssh_config    
debug1: Applying options for *       
debug2: ssh_connect: needpriv 0     
debug1: Connecting to 192.168.1.2 [192.168.1.2] port 22.  
debug1: Connection established.  
debug3: Not a RSA1 key file /Users/MYUSERNAME/.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  
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/MYUSERNAME/.ssh/id_rsa type 1  
debug1: identity file /Users/MYUSERNAME/.ssh/id_rsa-cert type -1  
debug1: identity file /Users/MYUSERNAME/.ssh/id_dsa type -1  
debug1: identity file /Users/MYUSERNAME/.ssh/id_dsa-cert type -1  
ssh_exchange_identification: Connection closed by remote host  

Upvotes: 0

Views: 1999

Answers (1)

264nm
264nm

Reputation: 755

By the looks of it the issue is just completely based on the key being corrupt or something.

The logs say firstly that your public key isn't an RSA key despite it being named so, it attempts to begin reading it regardless to see if it could work it by itself and then it fails to read it. Sounds like corrupted key file to me.

My advice would be to delete your ssh keys etc and start again, or as an interim measure change your configuration to allow password auth instead of key based.

If you want to remove the keys, open up a terminal and:

rm -R /Users/MYUSERNAME/.ssh/id_*

To generate new ones for secure passwordless login:

ssh-keygen -b 1024 -t rsa -f id_rsa -P ""

Upvotes: 2

Related Questions