helsing, I have the same issue as you.
I want to rsync from Host B to host A via ssh (actually, I'm using Unison instead of rsync so that the transfer is bi-directional). But ssh for the www-data user still demands a password after the ssh certificate is installed to /var/www/.ssh/authorized_keys.
I managed to make it work by changing the home directory from /var/www to /home/www-data in /etc/passwd. No more password prompts when using ssh to login as www-data. As for /var/www, I made it a symbolic link to /home/www-data.
Now my command runs without prompts (as root):
su - www-data -c "unison /var/www ssh://email@example.com//var/www -batch"
Originally Posted by helsing
thanks for the reply.
i can get wwww-data to run everything in my script from a browser/php exec() with the exception of of my scp/pscp command - it seems putty can't cache the server key for www-data so i get that cache prompt every time. i put an .ssh folder inside /var/www/ thinking putty might cache the key there but to no avail. maybe this topic should be on a different forum.