DEV Community

Dx Panda
Dx Panda

Posted on

Copying a file from EC2 to S3 using PuTTY

1. Create a EC2 Instance
Image:
Image description

2. Install PuTTY
Image:
Image description

3. Change Inbound rules to "MyIp" in that created Instance.

4. Creating a IAM role and enable the policy with S3 to connect the EC2 Instance accordingly.
Image:
Image description

5. Using PuTTYgen upload the key pair(.pem) that we used, and make it as a Private key with the Extension of (.ppk).

6. Uing PuTTY after pasting the Public ip that is created in Instance go to Connection->SSH->Authentication->Credentials in that browse and select the (.ppk) Private key that is created using PuTTYgen click open to connect it to the Instance.

7. We want to create a text file and upload that text file in S3. We have to use the command echo "ThisIsItSasuke" > details.txt to save the content which is in the echo statement, then use "aws s3 ls" to view the S3 bucket initially it is Empty. We want to send or upload the details.txt to S3 by using the Command aws s3 cp details.txt s3://arset/ which is used to copy the text file to the S3 bucket.
Image:
Image description

Image description

8. Once it is done we can see that the details.txt file is available in S3. We can see the Contents which is stored in that also.
Image:
Image description

Flow Structure:

Image description

Top comments (0)