Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Suppose there's two pc - "A" and "B". Then if A downloads a files from B , then what would be the file permission of that downloaded file? Is it possible that the downloaded file in A will have an Inode entry with all it's permissions from B & store B's user account as the owner ? If that's the case then is it impossible to change that files permission on A if "others" [as in user-group-others] doesn't have the right to write on that file?

e.g. if this is the case , __x __x __x file.txt [On B]

then what would be the file permission on A of that same file downloaded from B [e.g. through vsftpd]?

  1. __x __x __x file.txt [On A]

or

  1. rw_x rw_x rw_x file.txt [On A] [i.e. defined by A's default umask value]
share|improve this question
    
Downloading means read, transport and write.. so the downloaded file will be with permission for the user who is logged in B because you are writing there. Maybe some expert can explain well. –  Web-E Apr 13 '12 at 15:35

1 Answer 1

up vote 0 down vote accepted

The downloaded file will have the permissions depending on the system A settings (umask). Basically at the moment the file is copied the file belongs to the user on A. To be more accurate, the data from the file is transferred to the ftp client on system A. Only the data, not the metadata (in the Inode) that holds access rights, ownership, create/access/modify date .... and other stuff. I could download the file via ftp and store it on a non unix file system (FAT) for example, that has none or a completely different security mechanism.

So basically in your case the ftp protocol is the problem.

If you want to transfer the ownership info as well you could use tarfor example to archive the file including (almost) all metadata. Then transfer the archive to A and extract it with the appropriate options to keep the original ownerships.

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.