• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1249
  • Last Modified:

How do I Hide a directory under linux?

I have been trying to hide a directory under linux and am having great trouble doing it. For some reason chmod +h doesnt work, it says it is an invalid mode. Can someone please tell me how to do this?

Worth 500 points.

Rick
0
richardsimnett
Asked:
richardsimnett
1 Solution
 
binary_1001010Commented:
you can make a hidden directory by placing a period in front of it, such as /home/richard/.hiddendir
The directory will not show up with a ls, but it will show up with a ls -al or ls -a command. It does nothing to prevent someone from getting into the directory either.
0
 
yuriskCommented:
There is no way to hide a directory the way you do in Windows. You can prevent
unwanted  users from reading the directory's content . To hide a directory you can place it under
the parent directory and then deny all access to other than the owner users to this parent dir.
0
 
pjedmondCommented:
Other than the suggestion above, the only way to hide a directory is to put the directory that you wish to hide into a directory that the user is not allowed to access:

chown root.root /my/container
chmod 700 /my/container

Now any folder put in /my/container will be invisible to anyone without root access.

If you are referring to folders being viewed by samba, or ftp then there are other options that can be used.

(   (()
(`-' _\
 ''  ''

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now