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?