I have a DMZ with a web server running Ubuntu 11.04 and an application server running Ubuntu 11.10. I have set things up so that I can scp from the web server to the application server by running
ssh-keygen ssh-copy-id firstname.lastname@example.org
where 192.168.1.6 is the local IP address of the app. server and peter is my login account name. However, I would like to copy the files in response to a call through a LAMP-based web site using a command in a PHP file. My problem is that the "user" of my web applications is www-data which is not a real user so I cannot create keys for it.
I tried the procedure outlined here. I then did
su su www-data
on the web server (I guess the "server" per the Berkeley discussion). Unfortunately, I still get asked for the password when I try to scp to the application server/client.
scp -vv /var/www/Src/*.txt 192.168.1.6:/var/www/Dest
The output was much the same as when I (successfully) scp from the peter account. However, these last few lines are different.
debug1: Authentications that can continue: publickey,password debug1: Offering DSA public key: /var/www/.ssh/id_dsa debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,password debug1: Offering ECDSA public key: /var/www/.ssh/id_ecdsa debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,password debug2: we did not send a packet, disable method debug1: Next authentication method: password email@example.com's password:
I would be most grateful if someone could tell me, or help me find, where the problem lies.