Provide bash scripts for AWS SSH and SCP with easily config environment in .env file
This command is used to remote to EC2 instance.
This command is used to download existing files in EC2 instance to local machine.
- Create .env file by using command below
cp .env.example .env
- Set values of each variable in .env
- Copy PEM file to project folder
- KEY_PATH - Path to PEM file, for example, key.pem
- USERNAME - username that use to login, for example, ec2-user
- HOSTNAME - hostname of EC2 instance, for example, ec2-xxx-xxx-xxx-xxx.ap-southeast-1.compute.amazonaws.com
- SOURCE_PATH - Path to source files in case of using SCP, for example, "~/*"
- DESTINATION_PATH - Path to destination folder in case of using SCP, for example, ./download