Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hey guys, here's what I would like to happen -- not sure if it can be done though. I want people who have no business with a file to not even see it exists.
Let's say we have a file called foo.txt
foo.txt belongs to cooluser:coolgroup and has permissions 750
As it is, if a user named 'tux' comes along (and does not belong to coolgroup) tux cannot view/modify/delete/execute/anything the file... but tux can still see it's there. Is there any way to set files to be hidden from certain users based on their permissions or otherwise? Even if this can not ever be done I'd like to know that.
If you take away permissions for the directory containing the file they won't be able to see the file exists. I don't think you can do anything more than what you have done to the file though.
I believe the only way to hide a file is to keep them out of the directory the file is in. Take away r and x permissions on the directory. w permissions is meaningless without x.
Nope, UNIX or Linux permissions are read, write, execute, setuid, setgid. The only way to hide a file or directory is to place a period before the name. I think NFS or SAMBA can do it though.
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282
Rep:
Quote:
Originally Posted by Electro
The only way to hide a file or directory is to place a period before the name.
Even then, that doesn't equate to 'hide' in this context - it's just a hint to directory listings to suppress it by default. Bash's autocomplete will list dot-hidden files by standard, and it's very easy to see them in almost any other context. Hiding files like this is essentially a way of stopping seldom-used files and directories from cluttering up your standard directory view unnecessarily.
Even then, that doesn't equate to 'hide' in this context - it's just a hint to directory listings to suppress it by default. Bash's autocomplete will list dot-hidden files by standard, and it's very easy to see them in almost any other context. Hiding files like this is essentially a way of stopping seldom-used files and directories from cluttering up your standard directory view unnecessarily.
You sound like I should be hung. I told the truth, but other posters just said to not include read, write, execute on a file although the question was to hide the file. The only way to definitately hide the file from the user is to move it to a directory that the user can not access.
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282
Rep:
Sorry if I came off like that, I didn't mean to say that your advice was wrong, and I'm sure you knew everything I said anyway. I just wanted to clarify things for the sake of the OP and anyone else reading the post!
I said I think, but I recently check the smb.conf manual. It is possible to hide files in SAMBA by including "hide files". Also there is "hide unreadable" and "hide unwritable".
Electro is correct about the hide files option (I haven't used hide unreadable or unwritable). There is also a veto files option.
hide files specifies a list of files that will have their msdos attribute set to hidden and veto files just won't display them at all. Have a look at http://us1.samba.org/samba/docs/using_samba/appb.html for more info.
YES! I added 'hide unreadable = yes' into the share's section of smb.conf and everything is great. Thanx a bunch for the help -- I had thought something like that existed but couldn't find it anywhere!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.