Solved

How do I Hide a directory under linux?

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now