Scp problems I am having

I am having problems coping files from one Raspberry Pi to the other. I have used the command in the past without any problems. Now I am getting this.

scp links.php ssh web@172.16.x.x:/var/www/html/index.php
web@172.16.x.x’s password:
scp: remote mkdir “/var/www/html/index.php”: Failure

If I try this command,

scp links.php ssh web@172.16.x.x:/var/www/html/
web@172.16.x.x’s password:
scp: dest open “/var/www/html/links.php”: Permission denied
scp: failed to upload file links.php to /var/www/html/
scp: stat local “ssh”: No such file or directory

When ssh frm web to sam and I try to copy, this is what I get.

scp sam@172.16.x.x/media/share/share/MyWebsite/index.php /var/www/html/
cp: cannot stat ‘sam@172.16.x.x/media/share/share/MyWebsite/index.php’: No such file or directory The file is on sam

I have done the same commands in the past with out any problems. Both user have (ALL : ALL) ALL permissions. The web Pi is a fresh install with a LAMP stack.

Could it have something to do with LAMP stack permissions?

I can ssh into web from sam, and I still cannot copy from sam to web.

On sam I am in the directory where the files are stored, when I am in web, I am in /var/www/html, I even created an index.php file. When I have done this in the past, I could copy all my files in sam to web without creating the files 1st. Both Pi’s are on the same subnet, but since I can ssh from one to the other, I don’t think that is my problem.

Stumped!

I only have a /.ssh folder on one Pi, I would think I should have it on both, the one that I installed the LAMP stack on does not have it. I can ssh between the Pi’s both ways.

I found for some reason, my Pi would not save any keys in ~/.ssh/known_hosts, the know_hosts was not created even though I could ssh from one Pi to the other without any problems. Something must have not install properly. I did another fresh install, and now I have the known_hosts file with keys in it.

My problem was permissions on the folder and I was using sudo. Apache must have made a change in the latest version copying files into /html. I never had that problem before.