[Gllug] how to exclude some users from a drive?

Andrew Farnsworth farnsaw at stonedoor.com
Wed Apr 2 20:54:20 UTC 2008


salsaman at xs4all.nl wrote:
> On Wed, April 2, 2008 22:12, Andrew Farnsworth wrote:
>   
>> Diego Giurgola wrote:
>>     
>>> Hi all, I have an Ubuntu machine; I have some drives that are mounted
>>> on the /media/ subdirectory. How can be my user the only user who can
>>> access to this drives/folders?
>>> Thanks.
>>>
>>> Diego.
>>>
>>>       
>> Diego,
>>   Just use the chown, chgrp, and chmod commands
>>
>> General Usage:
>> chown <new owner> <path to directory>
>> chgrp <new group> <path to directory>
>> chmod <world permissions><Group Permissions><Owner Permissions> <path to
>> directory>
>>
>>
>> specific example:
>> Assumptions:
>>    User = bob
>>    Group = bobs_group
>>
>> chown -R bob /media/mounted_volume
>> chgrp -R bobs_group /media/mounted_volume
>> chmod -R 077 /media/mounted_volume
>>
>> Note: 077 = No permissions to world, Read/Write/Execute permissions to
>> Group, Read/Write/Execute permissions to Owner
>>
>> Andrew Farnsworth
>> --
>> Gllug mailing list  -  Gllug at gllug.org.uk
>> http://lists.gllug.org.uk/mailman/listinfo/gllug
>>
>>
>>     
>
> Shouldn't that be chmod 770 ?
>
> Gabriel.
>   
Gabriel,
  You are correct, as usual I got this backwards.  See 
http://en.wikipedia.org/wiki/File_system_permissions#Octal_notation

For completeness, the following is the General form, followed by the 
corrected detail form.

General Usage:
   chown <new owner> <path to directory>
   chgrp <new group> <path to directory>
   chmod <Owner Permissions> <Group Permissions> <World Permissions>
              <path to directory>

chmod -R 770 /media/mounted_volume

Note:
-R Signals recursively chmod, chgrp, chown and you might not want to 
change these recursively, just restrict access to the top level.
770 = Read/Write/Execute permissions to Owner, Read/Write/Execute 
permissions to
Group, No permissions to World

Andrew Farnsworth

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list