简体   繁体   中英

How to download a file from an EC2 server using SSH & SCP

I have a server on EC2 that I'm trying to download a file from. I'm able to access the EC2 box like so:

$ ssh -i ~/Documents/mysite.pem ec2-user@ec2-50-100-100-100.compute-1.amazonaws.com

That gets me in the box and then I try the following:

scp -i /Documents/mysite.pem ec2-user@ec2-50-100-100-100.compute-1.amazonaws.com:.bash_history /Users/Me

But that errors with:

Warning: Identity file mysite.pem not accessible: No such file or directory.

is there a trick to getting scp to look for my pem file locally? Thanks

在pem文件上尝试chmod 400。

I have the same problem. None of the comments mentioned above work.

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