Hi Folks,
I've been toying with the following kind of question.
Is it possible to setup a directory (say ./invis) such that it is impossible for anyone (even the owner) to do 'ls' on it, or 'cd' to it, thus not being able to find out the names of files and subdirectories under./invis, but such that if you name such a file or subdirectory explicitly than you (as owner) have access to it?
I.e. in order to access anything under ./invis you have to know its name. E.g.
cat ./invis/myfile
cd ./invis/mydir
Ordinary "chmod 000 ./invis" will not work, since this prevents all acess of any kind ("permission denied").
But I have a feeling that this sort of thing should be possible somehow (without having any idea of how to do it).
Any comments?
Thank, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 26-Aug-06 Time: 12:42:46 ------------------------------ XFMail ------------------------------
On Sat, Aug 26, 2006 at 12:42:54PM +0100, Ted Harding wrote:
Ordinary "chmod 000 ./invis" will not work, since this prevents all acess of any kind ("permission denied").
But I have a feeling that this sort of thing should be possible somehow (without having any idea of how to do it).
chmod -r the directory, you will still be able to cd into subdirectories if you know the name of them, (see below for an example) although this won't stop people putting the read permission back although you could take a look at chattr and see if that has any funky features that will also help. Oh, and the other thing is removing the read permission won't stop them cd'ing into the directory, but it does stop ls.
adam@dylan:~$ mkdir foobar adam@dylan:~$ mkdir foobar/stuff adam@dylan:~$ mkdir foobar/stuff/morebar adam@dylan:~$ chmod -r foobar/ adam@dylan:~$ ls foobar/ ls: foobar/: Permission denied adam@dylan:~$ cd foobar/stuff adam@dylan:~/foobar/stuff$ ls morebar
Thanks Adam