How to stop SSH passphrase prompt? [closed]

Solution 1:

This line Enter passphrase for key '/Users/emai/.ssh/id_rsa': means that your key is protected by a password entered when that key was generated every time you use it it will ask for a password.

by running ssh-keygen one more time without entering the password you've generated another key. No password in the key - no password prompt :)

here is quote from ssh-keygen manpage:

Normally this program generates the key and asks for a file in which to store the private key. The public key is stored in a file with the same name but ``.pub'' appended. The program also asks for a passphrase. The passphrase may be empty to indicate no passphrase (host keys must have an empty passphrase), or it may be a string of arbitrary length. A passphrase is similar to a password, except it can be a phrase with a series of words, punctuation, numbers, whitespace, or any string of characters you want. Good passphrases are 10-30 characters long, are not simple sentences or otherwise easily guessable (English prose has only 1-2 bits of entropy per character, and provides very bad passphrases), and contain a mix of upper and lowercase letters, numbers, and non-alphanumeric characters. The passphrase can be changed later by using the -p option.

There is no way to recover a lost passphrase. If the passphrase is lost or forgotten, a new key must be generated and the corresponding public key copied to other machines.

Solution 2:

Building on stimur's answer, yes, ssh is asking for a key's passphrase. Which means you are using a key in the first place.

If that is what you want - a private key protected with a passphrase, you can use ssh-agent to remember the passphrase (or the decrypted private key, I'm not sure which one), so that you can login without typing the passphrase again. You can remember it indefinitely, or for a fixed amount of time.

man ssh-agent and man ssh-add!