Cannot able to transfer file from bastion or jump server to EC2 instance.

Prem ChoudharyPrem Choudhary
1 min read

While learning, I faced the issue of not being able to connect my bastion server or jump server to the EC2 instance for file transfer.
Here the solution:

  1. Open your terminal.

  2. Connect your bastion server with local system by ssh command.
    ssh -i /path/to/your-private-key.pem ec2-user@<Bastion-server-public-IP>

  3. Open WSL(Windows Subsystem for Linux).

  4. Run: chmod 400 /mnt/c/path/to/your-pem-key.pem

  5. Run: ls -l /mnt/c/path/to/your-pem-key.pem

  6. Run: scp -i ~/your-private-key.pem ~/your-pem-key.pem ubuntu@<Bastion-server-public-IP>.compute-1.amazonaws.com:/home/ubuntu/

    Thank you

0
Subscribe to my newsletter

Read articles from Prem Choudhary directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Prem Choudhary
Prem Choudhary

DEVOPS ENGINEER || AWS || JAVA || PYTHON || SPRING BOOT || SPRING SECURITY || REACT.JS || MONGO DB || MYSQL