Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to set up an X11 tunnel on Mac OS X Lion with (in one terminal):

ssh -L 2222:<remote machine>:22 <gateway server to remote machine>

This bit works fine and I get logged on to the gateway server, with (I guess) traffic arriving at my local port 2222 redirected to port 22 on the remote machine.

Then, in a second terminal, I try:

ssh -X -p 2222 localhost

but I get permission denied when I'm asked for my password (that of localhost, my MacBook Pro). The odd thing is that I can "ssh localhost" with no problem at all. If I add -vvvv to the last command, some key errors appear:

debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [::1] port 2222.
debug1: Connection established.
debug3: Not a RSA1 key file /Users/<my username>/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype

Any idea what I'm doing wrong here?

share|improve this question

1 Answer 1

In logs, you always search for the first line containing the error.

debug3: Not a RSA1 key file /Users/<my username>/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype

It tells you that the key file is incorrect, so you should verify if it is indeed a RSA1 key file.

man ssh-keygen might help you create this file properly...

share|improve this answer
    
Thanks, but if I can ssh localhost (without using port 2222), doesn't that suggest the key is OK? –  user293594 Apr 11 '12 at 14:39
    
@user293594: Perhaps local users don't need to be verified? Not sure, but it is an issue to be solved. –  Tom Wijsman Apr 11 '12 at 14:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.