Question

I'm trying to download access logs from an AWS EC2 instance to my local machine using the following command:

scp -i private-key.pem ec2-user@ec2-public-dns-address:/path/to/filename

But I keep getting an error saying "Permission Denied" (rather than "Permission Denied (publickey)"). Any idea what's wrong?

Était-ce utile?

La solution

Most probably, you are trying to download a file, to which your default user doesn't have access. Example: downloading a db dump from /tmp/dump/ to which only root user has access.

If that is the case, ssh on the instance, move/copy the file to a location accessible for your user, and make it the owner of the file, and then ssh out and scp.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top