Setting up a SSH config file provides a convenient way to:
Create the config file ~/.ssh/config if it does not already exist
~/
.ssh/
config
Add an entry to the config file, for example
Host circuitmonk
HostName www.circuitmonk.com
User ec2-user
IdentityFile /Path/to/your/ssh/private/key.pem
IdentitiesOnly yes
Now, we can ssh into the host more conveniently
# more convenient
ssh circuitmonk
# instead of
ssh -i path/to/ssh/private/key ec2-user@www.circuitmonk.com
We can copy files from our local machine to the host
scp /local/file circuitmonk:/path/on/host
# instead of
scp -i path/to/ssh/private/key /local/file ec2-user@www.circuitmonk.com:/path/on/host
Pushing to a remote git repository on the host is also easy
git remote add circuitmonk circuitmonk:/path/to/git/repository/on/host
git push circuitmonk +master:refs/heads/master