Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: HOWTO: Hide unix file structure

  1. #1
    Join Date
    Mar 2005
    Location
    Freiburg/Germany
    Beans
    653
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    HOWTO: Hide unix file structure

    The unix file structure developed over decades, and has withstood the test of time pretty well, for a large variety of uses - servers, computer pools, home desktops, and more. But for new users it can be confusing - "What exactly is a /var? What's /usr, I am the user, so do I put my stuff there? And why can't I write into that directory? Linux is so hard!" The answer is, of course, if you don't know about it, you probably don't need to do anything there, or even know it exists. Default Breezy already makes going outside the boundaries of the /home/ directory mostly unnecessary. But some people, even new users, like exploring, and are used from other operating systems to start at the top of the structure. So the next time you set up a Ubuntu install for inexperienced users, consider the following:

    1. Open a terminal and execut "ls -1 / | sudo tee /.hidden"

    2. Do "sudo chmod a+r .hidden"

    3. If you want all standard files hidden, skip to 5. Otherwise. open the file with "sudo gedit /.hidden".

    4. Remove every directory you don't want to hide from the file. Here's how mine looks like, as an example:
    Code:
    bin
    boot
    opt
    usr
    etc
    sys
    tmp
    srv
    proc
    root
    sbin
    lib
    lost+found
    mnt
    initrd
    dev
    debootstrap
    var
    cdrom
    initrd.img
    initrd.img.old
    vmlinuz
    vmlinuz.old
    home
    media
    5. Now, let's create some entries that are easier for new users: select "home" and create a link to link to it (for example, by dragging it and holding <ctrl>+<shift>. Your mouse cursor should show two linked circles when dragging while holding them, if they do you're creating a link). Rename that link to "User Data" or something similar. Do the same with media; rename it to "Drives" or "Media" or what you want. (If the files are already hidden. show them with <ctrl>-<h>.)

    6. If you want to have a discoverable way to some or all of the now hidden files, create a folder called "System Data". Create links to all the other files and directories there.

    7. You're done! Update an open Nautilus with <ctrl>-<r>, or restart it with "killall nautilus".

    I attached a screenshot of how it looks like.

    Now, some anticipated FAQs:

    Q: Won't this royally screw my system?
    A: I see no reson why it should. Everything is still in it's original place, only no longer visible by default. It definitely works fine here and on several other Ubuntu installations.

    Q: Are there any negative side effects?
    A: Not that I know of. From the command line, everything stays the same. If you encounter any problem, please tell me!

    Q: I want to access one of the hidden folders. How do I do that?
    A: View -> Show Hidden Files. Or press <ctrl>-h

    Q: I don't like this! How can I undo it?
    A: Simple, just remove the .hidden file. Delete the links you created in step 5 and 6 if you want, or leave them there. Just make sure you don't accidentally delete the original folders.

    Q: Can I have all the files shown automatically if I have a sudo'd nautilus?
    A: Certainly. Make sure that the .hidden file is owned by root (should be automatically), then, in the permissions tab, disallow read access for the owner.

    Q: Can I do that .hidden stuff in other directories too?
    A: Yes. It's a pretty cool feature.

    Q: Are there any limitations to this?
    A: Yes, the file selector (ie open dialog) will still show all the files. The .hidden file currently only applies to Nautilus.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	root.png 
Views:	672 
Size:	49.7 KB 
ID:	2911  
    Last edited by Wolki; October 21st, 2005 at 03:25 PM.

  2. #2
    Join Date
    Jul 2005
    Location
    Metro DC area, United States
    Beans
    Hidden!

    Re: HOWTO: Hide unix file structure

    Very interesting howto. I wonder, though, would it not be better to educate a new user rather than hide things from her or him? It's not at all hard to go over the directory structure with someone after you install Linux on her or his computer. If new users ask about not being able to write to certain directories, it would be far better to use that question as a jump-off to teach them about permissions.
    If you want to know what a man's like, take a good look at how he treats his inferiors, not his equals.
    ~Sirius Black, Harry Potter and the Goblet of Fire

  3. #3
    Join Date
    Mar 2005
    Location
    Freiburg/Germany
    Beans
    653
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Hide unix file structure

    Quote Originally Posted by macgyver2
    Very interesting howto. I wonder, though, would it not be better to educate a new user rather than hide things from her or him?
    It's a good idea to teach users, but not everyone wants to learn that much. I've intended this howto to leave options for future learning open, so people can advance at their own pace. There is a lot to learn when you start using an unfamiliar system, and I think there are things that matter more than the classical file system.

    Thank you for reading and commenting

  4. #4
    Join Date
    May 2005
    Location
    Puerto Rico
    Beans
    93
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Hide unix file structure

    Does the hidden file goes in / ?

    EDIT: BTW, I found another trick by setting the permisions of / as 722

    or sudo chmod 722 /
    Last edited by joelito; October 17th, 2005 at 04:56 PM.
    If you tried everything and still won't work....


    Beat it with a hammer

  5. #5
    Join Date
    Mar 2005
    Location
    Freiburg/Germany
    Beans
    653
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Hide unix file structure

    Quote Originally Posted by joelito
    Does the hidden file goes in / ?
    Exactly. My instructions above were not clear, thanks for pointing it out!
    And it's ".hidden", the dot is important

    EDIT: BTW, I found another trick by setting the permisions of / as 722

    or sudo chmod 722 /
    Hm, what do you accomplish with this? rwx--x--x does not make sense to me as a setting for root, but maybe I'm missing something.
    Last edited by Wolki; October 19th, 2005 at 12:20 AM.

  6. #6
    Join Date
    Nov 2004
    Location
    Texas
    Beans
    2,434

    Re: HOWTO: Hide unix file structure

    Great Guide. I will use this for new users in the future. Good job.
    Those folks who try to impose analog rules on digital content will find themselves on the wrong side of the tidal wave.
    - Mark Shuttleworth

  7. #7
    Join Date
    May 2005
    Location
    Puerto Rico
    Beans
    93
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Hide unix file structure

    I did the chmod thing because I wanted to hide all the directories in / to everyone but the admin mode (gksudo nautilus) however I still wanted applications to run so I used the 722.
    If you tried everything and still won't work....


    Beat it with a hammer

  8. #8
    Join Date
    Jan 2005
    Beans
    20
    Distro
    Ubuntu Breezy 5.10

    Re: HOWTO: Hide unix file structure

    Sounds good. Unfortunatly... it doesn't work for me.
    I did a "ls > .hidden" as root in /.
    View hidden files is off in nautilus and everyone has reading rights on the .hidden file. What else can it be?

  9. #9
    Join Date
    May 2005
    Location
    Puerto Rico
    Beans
    93
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Hide unix file structure

    Ok wolki, I tried your methot, It worked better than mine...

    All we need now is enough people to want this by default.

    I mean, it would be cool to have that in dapper
    If you tried everything and still won't work....


    Beat it with a hammer

  10. #10
    Join Date
    Oct 2005
    Beans
    56
    Distro
    Ubuntu Breezy 5.10

    Re: HOWTO: Hide unix file structure

    Quote Originally Posted by macgyver2
    Very interesting howto. I wonder, though, would it not be better to educate a new user rather than hide things from her or him? It's not at all hard to go over the directory structure with someone after you install Linux on her or his computer. If new users ask about not being able to write to certain directories, it would be far better to use that question as a jump-off to teach them about permissions.
    good point about educating the user. but i can see a use for this in situations like publicly available workstations, student labs, etc.

    most people will stay honest if they arent tempted by something...
    of course, this shouldnt be considered your entire security strategy, but a little abstraction goes a long way

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •