I do not have the Ec2 .pem file and looking to copy a csv file to EC2 instance using session manger. Can anyone please help me with this?
Asked
Active
Viewed 745 times
1

John Rotenstein
- 241,921
- 22
- 380
- 470

DSi
- 93
- 6
-
1It's normally easier to copy the file to an Amazon S3 bucket. Then, connect to the Amazon EC2 instance and download the file from S3. Or, this article suggests a way to use SSH/SCP via a Session Manager connection: [AWS Session Manager with Enhanced SSH and SCP Capability](https://linuxhint.com/aws-session-manager-with-ssh-and-scp-capability/) Or, you could generate a new PEM file and put the **public** half of the keypair into the `/home/ec2-user/.ssh/authorized_keys` file via your Session Manager session. (Just paste the keypair into a text editor on the remote end.) – John Rotenstein Nov 03 '22 at 09:21
-
Thanks @John i can check Connecting ec2 instance to s3 bucket – DSi Nov 03 '22 at 16:16
-
1You don't really "connect" the EC2 instance to the S3 bucket. Instead, you provide credentials to the EC2 instance by assigning an IAM Role (with permissions to access S3) to the instance. Then, you can _access_ the S3 bucket from the EC2 instance, such as using the [AWS Command-Line Interface (CLI)](http://aws.amazon.com/cli/) to download the file from an S3 bucket. – John Rotenstein Nov 03 '22 at 21:00