scp (secure copy) to ec2 instance without password
I figured it out. I had the arguments in the wrong order. This works: scp -i mykey.pem somefile.txt root@my.ec2.id.amazonaws.com:/
I figured it out. I had the arguments in the wrong order. This works: scp -i mykey.pem somefile.txt root@my.ec2.id.amazonaws.com:/
You need to scp something somewhere. You have scp ./styles/, so you’re saying secure copy ./styles/, but not where to copy it to. Generally, if you want to download, it will go: # download: remote -> local scp user@remote_host:remote_file local_file where local_file might actually be a directory to put the file you’re copying in. To … Read more
Unlike ssh, scp uses the uppercase P switch to set the port instead of the lowercase p: scp -P 80 … # Use port 80 to bypass the firewall, instead of the scp default The lowercase p switch is used with scp for the preservation of times and modes. Here is an excerpt from scp’s … Read more
scp -r user@your.server.example.com:/path/to/foo /home/user/Desktop/ By not including the trailing “https://stackoverflow.com/” at the end of foo, you will copy the directory itself (including contents), rather than only the contents of the directory. From man scp (See online manual) -r Recursively copy entire directories