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 have a folder containing lots of backup images. I want users to only see their own files. I've tried setting the permissions to 000 but they still can see the file using ls (the backups belong to the user, set by chown).

I tried symlinking (creating the symlink in their /home/ directory and denied access to the backup folder), but it doesn't work. FTP sees the file as a folder and not as a file. Hardlinking does work, but when a new backup is written, the inode is changed and therefore breaking the hardlink.

Is there any other way I'm not thinking about?

share|improve this question
1  
Listing a directory is permitted through its read permission. Maybe distribute the files across subdirectories, owned by the respective users, with 700 permission? –  Daniel Beck Feb 11 '13 at 20:06
    
@DanielBeck We've got a complete backup system in place, it would be too much work to change everything hence I'm looking for a workaround. –  Devator Feb 11 '13 at 20:20
1  
Remove read permission from the folder containing the backups, but keep the x perm. Then write a cron script that creates a secondary structure: One folder per user, containing symlinks to all their own files. Restrict read access to these folders to the respective users. This way, you can keep your output in place and take users' ability to see others' backups while keeping their own backups accessible. (you could also hardlink these, but that'd make cleanup more difficult -- now you'd just delete the actual backup file, and the next cron job script run would clear away obsolete symlinks). –  Daniel Beck Feb 11 '13 at 20:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.