I have created a new key using ssh-keygen -t rsa without a passphrase. I have then transferred the key using ssh-copy-id [email protected] and then ssh'ed to the host using ssh '[email protected]' or scp and it admits me without prompting for a password. However, when I try to scp using the command scp -i ~/.ssh/id_rsa.pub test.wav [email protected]:/home/test/ it prompts me for a password.
It only prompts for a passphrase for the key and user when I use the -i identity_file option, and I would like to avoid this so it can be run in a script.