Solved

How do I Hide a directory under linux?

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

830 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