Find the answer to your Linux question:
Results 1 to 6 of 6
Code: jun@jun-laptop ~ $ ls -l /media total 12 lrwxrwxrwx 1 root root 6 2010-08-09 06:24 cdrom -> cdrom0 drwxr-xr-x 2 root root 4096 2010-08-09 06:24 cdrom0 drwxrwxrwx 1 root ...
  1. #1
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,230

    Help to chmod my Storage

    Code:
    jun@jun-laptop ~ $ ls -l /media
    total 12
    lrwxrwxrwx 1 root root    6 2010-08-09 06:24 cdrom -> cdrom0
    drwxr-xr-x 2 root root 4096 2010-08-09 06:24 cdrom0
    drwxrwxrwx 1 root root 4096 2010-08-31 17:28 Storage
    drwxr-xr-x 6 root root 4096 2010-08-11 22:48 Storage (B)
    jun@jun-laptop ~ $
    Code:
    jun@jun-laptop ~ $ df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda2              30G   26G  2.8G  91% /
    tmpfs                 1.5G     0  1.5G   0% /lib/init/rw
    varrun                1.5G  304K  1.5G   1% /var/run
    varlock               1.5G     0  1.5G   0% /var/lock
    udev                  1.5G  172K  1.5G   1% /dev
    tmpfs                 1.5G  472K  1.5G   1% /dev/shm
    lrm                   1.5G  2.2M  1.5G   1% /lib/modules/2.6.28-19-generic/volatile
    /dev/sda5              81G   20G   62G  25% /media/Storage
    /dev/sda6              72G   21G   48G  30% /media/Storage (B)
    jun@jun-laptop ~ $
    Hello!

    I created a "guest" user in my Mint and I don't like them to access my "Storage" & "Storage (B)".

    May I please ask how to do it using chmod. I tried to play around with it but it still automatically mounts in guest user environment.

    Thank you!
    nujinini
    Linux User #489667

  2. #2
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    855
    Methinks you should set owner in fstab. man fstab and man mount will help.

  3. #3
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    What is the filesystem of Storage and Storage B partitions?
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  4. #4
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    718
    As segfault suggested, provide fstab with the necessary information such that it mounts your stuff with a valid guid that matches a group that should be able to read/write stuff on that storage. Then set chmod o-rwx and nobody other than the specified group will be able to access it.

    All this can be done with:

    * addgrp
    * chmod
    * /etc/fstab

    Happy bashing.

  5. #5
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,230
    Thank you all!

    "Storage" is ntfs

    "Storage (B)" is ext4

    Yes, fstab also passed my mind. However, I also wanted to hear some other ideas if there are still other ways aside from editing fstab in the "guest" account.

    nujinini
    Linux User #489667

  6. #6
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    718
    Oh, yes .. and the users that should access that stuff must be added to the group.

    check if user already has group:

    id user

    add user to group:

    usermod -a -G group user

    finally check if everything is as it should:

    id user

Posting Permissions

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