If it is enabled for your ssh
installation, you should follow a procedure to create what are known as public encrypted keys, and then use those keys to auto-log you in. It is rather quite an easy procedure, and you should be able to bypass the whole password entry issue.
Search the net with the search phrase, "generate rsa keys pairs ssh" to find a plethora of pages which describe the process. Here is just one such link.
I typically do not use a pass phrase. I'll let other commentators provide any justification to do the opposite.
whmcclos@mbp-wireless:~
[8] ls -ld ~/.ssh
drwx------+ 2 whmcclos staff 68 Feb 4 09:05 /Users/whmcclos/.ssh
whmcclos@mbp-wireless:~
[9] ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/whmcclos/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/whmcclos/.ssh/id_rsa.
Your public key has been saved in /Users/whmcclos/.ssh/id_rsa.pub.
The key fingerprint is:
77:93:ef:57:40:7d:ef:9b:6e:99:4a:a3:8a:8b:81:a9 whmcclos@Williams-MacBook-Pro.local
The key's randomart image is:
+--[ RSA 2048]----+
| . |
| . o|
| . o|
| .. .|
| S . + o |
| o . . o o|
| o . o. *|
| . o . o..*.|
| E . o.... .=o |
+-----------------+
whmcclos@mbp-wireless:~
[10] ls -l .ssh
total 8
-rw-------+ 1 whmcclos staff 1679 Feb 4 09:06 id_rsa
-rw-r--r--+ 1 whmcclos staff 417 Feb 4 09:06 id_rsa.pub
[11] cat $HOME/.ssh/id_rsa.pub | ssh myRemoteHost 'cat >> .ssh/authorized_keys && echo "Key copied"'
type in your password for the last time. Now, you should be able to ssh
into the remote host sans the password.
Please note that the $HOME/.ssh
folder is assumed to have been created on the two hosts, the one you are coming from and the one you are logging into. If they haven't, create those folders first, before doing the above. Also note that the permissions on the $HOME/.ssh folder should be set to chmod 700 $HOME/.ssh
on both hosts.
On step [9], just accept the default entry for each question, but it would be worth-while to learn what the questions mean.