I have a linux instance on AWS without a public IP address.
I know how to connect to it via the AWS CLI
aws ec2-instance-connect ssh --instance-id <INSTANCE_ID>
--private-key-file <PATH_TO_PRIVATE_KEY> --connection-type eice
How can I copy files from my local machine to my AWS instance? Usually I would use scp
, however I do not have a public IPv4 address. How can I do this via the AWS CLI?
Thank you very much!
2
Answers
You can try and do the
scp
using the below command, if it works then enjoy.You need to establish your ssh connection first using the command you posted and then run
scp
and make sure to replace the required values.ec2 instance connect doesn’t have the scp component. You could either use AWS systems manager
OR
you need to login the aws network using vpn or Directconnect