cdinto the directory that contains the files that you want to transfer.
scp -i $KEY -r $(pwd) ec2-user@$HOST:/home/ec2-userto copy your entire working directory to the home directory of your VM. (tip: this method assumes you’re not connected yet. If you are though, press Ctrl + D to disconnect).
FileZilla (Mac & Windows)
- Alternatively, install File Transfer Protocol (FTP) client FileZilla.
- Click on File > Site Manager > New Site.
- Change the protocol to “SFTP”.
- Use the public IPV4 DNS address (see AWS console) as the host name.
- Choose “Key file” as the logon type, set the username to
ec2-user, and add your
*.pemfile as the key file.
- Click on “Connect”. On the right side, all files on the EC2 Instance are listed, and on the left side you can find the files on your local machine. To copy files from one place to another, you can simply drag and drop them between both windows.