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'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.

share|improve this question
1  
what does this show? ssh user@server 'ls -l /path/to/source/file.gz' –  johnshen64 Jun 4 '12 at 20:36
3  
As noted, the permissions are OK for reading the file, and are not the issue. You post a mock-up path - perhaps in reality you are trying to use a path with e.g. spaces and don't escape them properly. Give the "real" command instead of the synthetic one so we can spot any such errors. –  Daniel Andersson Jun 5 '12 at 6:48

1 Answer 1

r (only) permissions don't indicate a read-only filesystem. They indicate that the file is read-only.

The third r indicates that anybody can read the file so there shouldn't have been a problem.

The question is what are the permissions for the parent directory of this file? However, if they're wrong you should have gotten a permission denied error.

Are there any other conditions which might affect this file's availability such as an NFS mount, etc.?

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.