Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

For example, I want all the files in /home/trusktr/Downloads/ to remain hidden from other users, except for one.

I tried chmod 777 /home/trusktr/Downloads/someFile.avi but someFile.avi is still invisible to other users.

How do I make only someFile.avi visible to all users?

RELEVANT INFO PERHAPS:

┌─[21:48:25/starlancer/trusktr/~]
└─╼ ls -ld /home/trusktr
drwx------ 80 trusktr users 4096 Jan  9 21:29 /home/trusktr/

┌─[21:48:34/starlancer/trusktr/~]
└─╼ ls -ld /home/trusktr/Downloads
drwxr-xr-x 8 trusktr users 4096 Jan  9 20:57 /home/trusktr/Downloads/

┌─[21:48:43/starlancer/trusktr/~]
└─╼ ls -l /home/trusktr/Downloads/someFile.avi 
-rwxrwxrwx 1 trusktr users 2575522316 Jan  9 20:40 /home/trusktr/Downloads/someFile.avi*
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

The drwx------ on your home directory is preventing other users from traversing it, i.e. seeing the Downloads folder and its contents. You can let others through to see files they know the path to but prevent them from listing your files with --x perms, so you'll want to chmod 711 /home/trusktr, and check that other files and directories in there have appropriate permissions.

share|improve this answer
    
Wow, great fact! That's the tiny piece of knowledge I was missing all along. –  trusktr Jan 10 '13 at 6:08
    
Any idea why making a symbolic link to it in some other global folder doesn't let users read the file through the symbolic link, but why using real links (i.e. not using the -s switch) works just fine? –  trusktr Jan 11 '13 at 3:15
1  
Symbolic links are nothing but a textual pointer to the file - "the file you're looking for is really at ../foo.bar, look there." That's why the permissions on them are always 777. Hard links are normal files, they just happen to point to the same spot (inode) on the hard drive that another file does. –  Kevin Jan 11 '13 at 3:21
add comment

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.