scp No such file or directory
- by Joe
I've a confusing question for which superuser doesn't seem to have a good answer, and neither google.
I'm trying to scp a file from a remote server to my local machine. The command is this
scp user@server:/path/to/source/file.gz /path/to/destination
The error I get is:
scp: /path/to/source/file.gz: No such file or directory
user 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?
Thanks;
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.