Home > Net >  AWS EC2 (AWS Linux) how I access a private instance
AWS EC2 (AWS Linux) how I access a private instance

Time:10-19

I cannot access a private instance (AWS Linux)
What i try to do( Image )

I tried to access the DB Server instance(without public ip) using ssh -i key.pem user@private_ip, but it didn't work for me; As the VPC by default allows the connection between its subnets, try to upload the key.pem to the WEB Server instance and there I connect with ssh -i key.pem user@private_ip; but AWS does not allow me to upload to this file.

Could you help me with some guidelines on how to solve this problem please.

CodePudding user response:

but AWS does not allow me to upload to this file.

You upload it to your bastion using scp. If you can ssh to the bastion, you can scp your key as well.

But these days its probably better idea to use ssm session manager to ssh to your private instance. This does not require any bastion host, and has many advantages over traditional ssh login.

  • Related