Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.