Cant copy from my local machine to my online server even as a root user

I am trying to copy a folder as a root user from my local machine to my server using the command

sudo scp -r simple-app.zip james@ip:/home/jobs 

But I keep getting permission denied every time. And this is after I have logged into my server successfully.

I need help doing this.


Solution 1:

You are running scp command as root on your local computer. But you are not root at your remote computer - you are james there. Check if james has write permissions in /home/jobs or maybe you missspell destination folder and it should be /home/james/jobs?