Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I Hide a directory under linux?

Posted on 2006-07-09
3
Medium Priority
?
1,246 Views
Last Modified: 2012-05-05
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
Comment
Question by:richardsimnett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Accepted Solution

by:
binary_1001010 earned 2000 total points
ID: 17067696
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
 
LVL 4

Expert Comment

by:yurisk
ID: 17067714
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
 
LVL 22

Expert Comment

by:pjedmond
ID: 17067734
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question