Using pscp and getting permission denied

1

I'm using pscp to transfer files to a virtual ubuntu server using this command:

pscp test.php user@server:/var/www/test.php

and I get the error permission denied. If I try to transfer to the folder /home/user/ I have no problems.

I guess this has to do with that the user I'm using doesn't have access to the folder /var/www/. When I use SSH I have to use sudo to get access to the /var/www/ path - and I do.

Is it possible to specify that pscp should "sudo" transfers to the server so I can get access to the /var/www/ path and actually be able to transfer files to this folder?

Espen

Posted 2010-12-21T19:29:14.637

Reputation: 113

Answers

1

You're most likely correct that you don't have access to /var/www/. What you can do is chmod /var/www/ to allow guest to write and change it back to original state once complete (I would advice against this). You can add the user to the group that owns /var/www/ and make sure the group is set for read/write/execute.

ngen

Posted 2010-12-21T19:29:14.637

Reputation: 1 393