SSH: connect with public key avoiding passphrase prompt

Somebody asked:

[email protected]:/# ssh -i /opt/ [email protected]
Enter passphrase for key '/opt/':
[email protected]'s password:

I have created key pair without passphrase, is it possible to get rid of passphrase prompt while connecting to remote server?

I would like to use key connection while using this command:

tar -c /opt/lampp/htdocs/somehost | ssh -i /opt/ [email protected] 'tar -xvf - -C /opt/somefolder' > /dev/null 2>&1 &

So that files transfer continue even if terminal have lost connection.

My answer:

You can remove (or change) the passphrase using the -p option to ssh-keygen. For example:

ssh-keygen -f /opt/id_rsa -p

Press Enter at the new passphrase prompt to remove the passphrase.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.