I'm trying to
scp (secure copy) a file from a remote server to my local machine. The command I am using is this:
scp user@server:/path/to/source/file.gz /path/to/destination
But the error I get is this:
scp: /path/to/source/file.gz: No such file or directory
The “user” in the
scp command is my username on the server. The command syntax appears fine to me.
ssh works fine and I can
cd to the file and it doesn’t seem to be an access control issue?
EDIT: Thank you John. I spotted the issue.
ls returned this:
-r--r--r-- 1 nobody users 168967171 Mar 10 2009 /path/to/source/file.gz
So, the file was on a read-only file system and user is able to read it but not
scp. I just copied the file to a different directory and
chown it and worked fine. It would be good if someone can explain why this is the case though.