LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Linux Answers > Security
User Name
Password

Notices

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):
Code:
dd if=/dev/zero of=/root/name_of_virtual_disk bs=1M count=10
Format the disk to ext3:
Code:
mkfs -t ext3 /root/name_of_virtual_disk
You will get the message below, press 'y' at the prompt:
Quote:
/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:
Code:
mkdir /root/mount_point
Now mount your new virtual disk to your mount point:
Code:
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:
Code:
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:
Code:
mount -t auto -o loop /root/name_of_virtual_disk /root/mount_point


  



All times are GMT -5. The time now is 12:56 AM.

Main Menu

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