I need to copy files from my computer to my server's folders in /var/www so they are uploaded to my cloud. Here's what I try to do:
I open my computer's terminal and type:
scp /media/user/Files/Documents/documents.docx email@example.com:/var/www/documents
Notes on this step
- The hard drive that I am trying to copy the file from is an NTFS formatted drive. I use this drive to store all my media on, in other words it has no operating system on it. I use a separate SSD with dual boot for my operating system. Also, this drive is mounted when I do this.
- 'ubuntu' is the actual username of the server I am trying to copy to.
Then it asks me for that computers password and then I get:
scp: /var/www/documents/documents.docx: Permission denied
What's wrong here?
- After much Googling, I found it may be a permission issue, so I tried the various solutions with no luck. The most common solution I tried was adding a user to the group. I would add the server's user (ubuntu) to the group, but that didn't help. Am I supposed to add my computer's username to the group? If so, do I add the stuff before the colon, after the colon, or both?
- I understand that one method to get around this would be to copy the files to my server's home directory, and then cp them to /var/www through SSH, but I would rather not do that because its an extra step.
Any help would be greatly appreciated!