Using scp to copy a file to Amazon EC2 instance?
second directory is your target destination, don't use server name there. In other words, you don't need to mention machine name for the machine you're currently in.
scp -i /path/to/your/.pemkey -r /copy/from/path user@server:/copy/to/path
-r if it's a directory.
Try specifying the user to be ec2-user
, e.g.
scp -i myAmazonKey.pem phpMyAdmin-3.4.5-all-languages.tar.gz [email protected]:~/.
See Connecting to Linux/UNIX Instances Using SSH.
Your key must not be publicly viewable for SSH to work. Use this command if needed:
chmod 400 yourPublicKeyFile.pem