How to copy a file from laptop to EC2

Unus AWS
Unus AWS
1.9 هزار بار بازدید - پارسال - How to copy a file
How to copy a file from laptop to EC2

Part 1 - Copy file from laptop to EC2:
Command syntax:
scp -i path/to/pem path/to/file username@PublicDNS:~/file-path-in-EC2

Ex:
scp -i "mykey-keypair.pem" hello-world-file [email protected]:~/hello-world-file-copied

This will copy file hello-world-file  from my laptop to the home directory of the user  (ubuntu) in the target EC2. (homedir is  /home/ubuntu/). The new file name will be hello-world-file-copied.

The keypair name for the EC2 is mykey-keypair.pem.


Part 2 - Copy file from EC2 to laptop:
Command syntax:
scp -i "mykey-keypair.pem" [email protected]:~/hello-world-file-updated hello-world-file-v2  

This will copy file hello-world-file-updated  from the EC2 to the current directory in laptop from where I am issuing the command. The new file name will be hello-world-file-v2.
پارسال در تاریخ 1402/03/12 منتشر شده است.
1,951 بـار بازدید شده
... بیشتر