AWS
EC2
Connect to EC2
#!/bin/bash
ssh -i key.pem ec2-user@public-dns
Copy files from EC2 to local
scp -i key.pem ec2-user@public-dns:path/to/file /your/local/directory/files/to/download
# zip directory beforehand
zip -r all.zip /your/ec2/directory/
# download all files
scp -i key.pem ec2-user@public-dns:~/* /your/local/directory/files/to/download
Onboarding
Install Git
sudo yum install git -y
Install Node (see also AWS Docs):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install node
# check
node -e "console.log('Running Node.js ' + process.version)"
Switch to dedicated version (check nodejs.org):
nvm install 16.13.0
Use Screen to use different sessions for different scripts for example.
Last updated