Solved

How do I Hide a directory under linux?

Posted on 2006-07-09
3
1,239 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 500 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

729 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