I need to a ssh proxy server using a ssh keypair that I created specifically for it (not my default id_rsa keypair). I see from the ssh MAN file that there is a -i option that I can use to specify the new ssh keypair that I want to use.

I'm not sure how to actually invoke the -i option (I can't seem to find examples of the option in use). If this is the standard ssh command, how would I add the option? For the purpose of this question, assume that my new keypair is called id_custom.

ssh -N -D 8080 username@proxy.server.com

I tried adding identityfile=/Users/username/.ssh/id_custom to the end and it didn't work. (I saw this option in ssh - How to specify key in SSHFS?).

  • A colleague helped me out. It looks like this is the solution: ssh -i ~/.ssh/id_custom -N -D 8080 username@proxy.server.com – Paul Jacobson Jan 2 '18 at 7:22
  • You may find this answer useful. – Kamil Maciorowski Nov 4 '18 at 21:00

For AWS EC2 ssh, I use it like this:

ssh -i mykeypair.pem *user_name*@ec2-*publicDNS.zone*.compute.amazonaws.com

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.