简体   繁体   中英

SCP not working from AWS ec2 instance when trying -i

I am trying to scp a file to my computer with the command:

sudo scp -i Documents/Professional/DiscMix/TestFile.pem ec2-user@-----.-----.compute-1.amazonaws.com: /csr.pem

But I keep getting the error: scp: .: not a regular file

What am I doing wrong?

I see that name of the file to copy is missing. Update your command as shown below to make it work.

sudo scp filetocopy.csv -i Documents/Professional/DiscMix/TestFile.pem ec2-user@ec2-34-xxx-xx-xxx.compute-3.amazonaws.com:/csr.pem

I didn't put the location to download in the command at the very end. My final command is: sudo scp -i DiscMixEc2.pem ec2-user@------.------.compute-1.amazonaws.com:~/csr.pem Downloads

 sudo scp -i DiscMixEc2.pem ec2-user@------.------.compute-1.amazonaws.com:/tmp

try first copying it to temporary folder and from there manually copy to u r destination folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM