Public key issue

I generated a public key that we are using for ssh and sftp but I noticed that I am still being asked for a password when I run my script. is there something I need to put in my script?

Our linux guy said he placed keys on both servers.

append your public key to remote server's ~/.ssh/authorized_keys
file

Also:

permissions on your home directory have to be 755 or stronger
permissions on your .ssh directory should be 600

Either of these will cause ssh passwordless login to fail.