I'm connecting to an AWS EC2 private instance (has Private DNS and IP, no Public DNS nor IP). I do it the following way:
- Agent forwarding: ssh-add private-instance.pem
Connect to bastion: ssh my-project.prd
.ssh/config
- connect to private instance: ssh ubuntu@private-ip-num
Connection to instance works fine, but whenever I try to install a package:
git clone https://github.com/aws/efs-utils
I get an error like the following:
fatal: unable to access 'https://github.com/aws/efs-utils/': Failed to connect to github.com port 443: Connection timed out
https://github.com/aws/efs-utils
This would cause git to connect through https rather than ssh. Your ssh setup would be irrelevant because git isn't using ssh. Is this your intention? Do you want git to connect through ssh or https? – Kenster