If you’re looking for an easy way to copy ssh keys from a MacOs machine to a server working as a bastion host.

Before this I used to copy the pem file , ssh into the server and make a file with the copied text. Then use that key to ssh into a machine.


The way I do it now is ssh agent forwarding.

Before you ssh into a machine, enter this command:

$ssh-add -K yourkey.pem

You should see an output of “Identity added”

Now when you ssh into the Bastion Host, instead of the -i just do this:

$ ssh -A user@IPADRESS


Afeter you ssh into the Bastion. You should be able to ssh into a server inside a private subnet of the same VPC.




Leave a Reply

Please Login to comment
newest oldest most voted
Notify of

The following time I learn a weblog, I hope that it doesnt disappoint me as a lot as this one. I imply, I know it was my choice to read, however I really thought youd have one thing interesting to say. All I hear is a bunch of whining about something that you might repair in case you werent too busy searching for attention.

Good day! This is kind of off topic but I need some help from an established blog. Is it tough to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about setting up my own but I’m not sure where to begin. Do you have any points or suggestions? Cheers