Welcome to the most active Linux Forum on the web.
Go Back > Linux Answers > Security
User Name


By binary_pearl at 2011-02-07 21:40
The description below only works if you are root. Based upon comments on the content below, there is a desire to do something similar, but as a non-root user. I'll try to see what I can come up with. In the meantime, here is a way to "hide" files if you are root:

One of the many neat things you can do in Linux is to create a "virtual disk" (which is really just a file), and you can add other files to it. We use this at work to store an xml file into a virtual disk that are xen virtual machines use when booting to configure themselves. But you could also use this as a way to more-or-less hide files.

So first: Create the virtual disk (The example creates a 10MB disk):
dd if=/dev/zero of=/root/name_of_virtual_disk bs=1M count=10
Format the disk to ext3:
mkfs -t ext3 /root/name_of_virtual_disk
You will get the message below, press 'y' at the prompt:
/root/name_of_virtual_disk is not a block special device.
Proceed anyway? (y,n)
Make a directory so you can mount your new virtual disk:
mkdir /root/mount_point
Now mount your new virtual disk to your mount point:
mount -t auto -o loop /root/name_of_virtual_disk /root/mount_point
copy whatever files you want into /root/mount_point/

Now unmount the disk:
umount /root/name_of_virtual_disk
The files that you just copied are no longer visible, but they are still stored within /root/name_of_virtual_disk

If you want to see your files again do the same mount command as above:
mount -t auto -o loop /root/name_of_virtual_disk /root/mount_point


All times are GMT -5. The time now is 03:11 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration