Results 1 to 5 of 5

Thread: chmod question

  1. #1
    Junior Member
    Join Date
    Jan 2005
    Posts
    8

    chmod question

    I come across files which tell me you dont have permission to read this....
    if I do root#chmod u=+rwx /dir/dir/file.doc I still get no access
    but if I do root#chmod uo+rwx /dir/dir/file.doc, I do get access....
    so why am I other and not user?

  2. #2
    Member registered user
    Join Date
    Jan 2005
    Posts
    42
    The u-flag stands for the user who owns the file. In your case root. The 'g'-flag stands for the group it belongs to and 'o' for all other users. That was the short explanation, now the long one:


    if you type 'ls -l' you get something like this:
    -rw-r--r-- 1 root root 0 2005-01-21 20:46 test

    The owner of the file 'test' is root and it belongs to the group root. The first - means that it is a file (a directory would show a d). -rw-r--r-- means that it is read- and writable for the owner (root), readabale for the group it belongs to and readable for all other users.

    If you now type 'chgrp users test ' and 'chmod g+w test' you get this:
    -rw-rw-r-- 1 root users 0 2005-01-21 20:46 test

    Now the file belongs to the user root and the group users. The group users has now write-access to the file (if not every user should have write-access you can change the ownership to an other group). I think, that's what you wanted.

    P.S.: If you want to change the owner of a file you can use the command 'chown nameofuser nameoffileordirectory'

  3. #3
    Junior Member
    Join Date
    Jan 2005
    Posts
    8

    so....

    if I want only console users to access a file, should create such a group and give them
    permission to do rwx

  4. #4
    Member registered user
    Join Date
    Jan 2005
    Posts
    42

    Re: so....

    'other' and users mean basically the same (normally every user is part of the group users): Every person with a useraccount has access. other doesn't mean, that people from the internet have access.

    So as long as you don't share your computer with people you don't trust or you are part of a big network (not the internet) it should be totally safe to give write-access to 'other' and/or 'users'. If this is not the case than you probably like to create a new group (or use an existing one). Login as root and type 'groupadd groupname'. You can add users to this group with the following command 'groupmod -A username groupname'.

    If you like to know which groups you are part of, type *tada* 'groups'.


    btw: If you like to know more about any of these commands type 'man commandname', e.g. 'man groupadd'.

  5. #5
    Member registered user
    Join Date
    Oct 2004
    Location
    Virginia, USA
    Posts
    65
    What I don't understand about this subject is why when I right click on a file on my desktop, and I change the permissions there, it doesn't seem to do anything, even if I am using file mgr as superuser.

Similar Threads

  1. chmod doesnt work ?
    By pdc124 in forum General Support
    Replies: 2
    Last Post: 07-27-2005, 10:35 PM
  2. file permissions (chmod doesnt seem to do anything)
    By mmcfly8888 in forum General Support
    Replies: 6
    Last Post: 04-16-2005, 05:15 AM
  3. Cannot login since I entered chmod command?
    By gopikrish in forum General Support
    Replies: 3
    Last Post: 08-21-2004, 12:12 AM
  4. How do I Undo a "chmod -R 777 on my /etc directory?
    By bob58 in forum General Support
    Replies: 1
    Last Post: 08-20-2004, 12:47 PM
  5. Grub settings, quick question... really my last question :p
    By mark1221 in forum Hdd Install / Debian / Apt
    Replies: 2
    Last Post: 11-01-2003, 10:32 PM

Posting Permissions

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


Gigabyte 4U AI Server 10x Nvidia GPU 2x Xeon Gold 6150 36 Core 2.7GHz DDR4 RAM picture

Gigabyte 4U AI Server 10x Nvidia GPU 2x Xeon Gold 6150 36 Core 2.7GHz DDR4 RAM

$1499.00



Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram  2x 550W PSU No HDD picture

Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD

$275.00



867959-B21 HPE ProLiant DL360 G10 CTO Server W/ 2x 865414-B21 1x 840140-001 picture

867959-B21 HPE ProLiant DL360 G10 CTO Server W/ 2x 865414-B21 1x 840140-001

$245.00



Dell PowerEdge R530 2x E5-2630v4 H330 iDRAC8 Port Card Riser No PSU/RAM/HDD picture

Dell PowerEdge R530 2x E5-2630v4 H330 iDRAC8 Port Card Riser No PSU/RAM/HDD

$99.99



Dell Poweredge R730xd 12LFF 2*2660v4 4*1Gbe h730 2x 750W Server CTO picture

Dell Poweredge R730xd 12LFF 2*2660v4 4*1Gbe h730 2x 750W Server CTO

$308.00



Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2690 v3 | 64gb Ram | 2x 1600W picture

Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2690 v3 | 64gb Ram | 2x 1600W

$524.99



Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2680 v3 | 32gb Ram | 2x 1600W picture

Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2680 v3 | 32gb Ram | 2x 1600W

$409.99



Supermicro 2U GPU Server SYS-2029GP-TR 2x Xeon 6130 32C 6x PCIe 3.0 x16 Slots picture

Supermicro 2U GPU Server SYS-2029GP-TR 2x Xeon 6130 32C 6x PCIe 3.0 x16 Slots

$745.00



Dell PowerEdge FX2s + 8x FC430 Blades 16x E5-2630v4 160 Cores Rails No PSU/RAM picture

Dell PowerEdge FX2s + 8x FC430 Blades 16x E5-2630v4 160 Cores Rails No PSU/RAM

$699.00



Remote Desktop User & Device RDS CALs for Windows Server 2025, 2022 & 2019 picture

Remote Desktop User & Device RDS CALs for Windows Server 2025, 2022 & 2019

$174.99