ssh -t -o ProxyCommand='ssh -i ~/.ssh/id_rsa opc@ -W %h:%p %r' -i ~/.ssh/id_rsa opc@

ssh -t -o ProxyCommand='ssh -i ~/.ssh/id_rsa opc@<publiIP> -W %h:%p %r' -i ~/.ssh/id_rsa opc@privateIP

From the first command I am getting output 1 :

Permission denied (publickey,gssapi-keyex,gssapi-with-mic). ssh_exchange_identification: Connection closed by remote host

From the second command I am getting output 2 :

~/.ssh/id_rsa.pub not found

Please help me to resolve this. I have created RSA public and private keys using putty.

1 Answer 1


The first version looks hinky, with the being a non-valid IP address. But perhaps that's a cloudy thing?

The second version looks better. Run it with "-v" before the "-t" and it will show you the enterpolated proxy command. Something like:

debug1: Executing proxy command: exec ssh -i ~/.ssh/id_rsa opc@<publiIP> -W privateip:22 opc

Now, run the command after the word "exec":

ssh -i ~/.ssh/id_rsa opc@<publiIP> -W privateip:22 opc

and see what error it shows. That'll tell you what you need to fix. I'm guessing you don't have a private key in the file ~/.ssh/id_rsa.pub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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