I use SSH and SCP commands in the shell and in scripts, a lot. Entering a password every time gets tiresome. Fortunately SSH can authenticate automatically if you store the private key of the remote system on your computer. I've been using this "setuptrust" script for years, it works flawlessly on all systems with a Bash shell and ssh-keygen installed.

The setuptrust script

#!/bin/bash
if echo $1 | grep -q @
then
  set $(echo $1 | tr '@' ' ')
fi
if ! [ $# -eq 2 -o $# -eq 4 ]
then
  echo "usage: username ip [-p port]" && exit 1
fi
[ ! -f ~/.ssh/id_rsa.pub ] && ssh-keygen -t rsa
user=${1}
pass=${2}
shift 2
cat ~/.ssh/id_rsa.pub | ssh "${user}"@${pass} $* 'mkdir -p .ssh; cat >> .ssh/authorized_keys'

 
Your Computer Remote Computer
.ssh/id_rsa .ssh/id_rsa
.ssh/id_rsa.pub .ssh/id_rsa.pub
.ssh/authorized_keys + .ssh/id_rsa.pub