FLOPPIX Home | FAQ | Download | Labs | ToC | Back |  Next 

Working with groups


Notes:

  1. Users can belong to one or more groups.

  2. Each group may be given different access permissions for working directories and programs.

  3. Ordinary users can determine which groups they belong to with the id command; and can change groups with the newgrp command.

  4. Only the superuser can add members to a group.


Exercises:

  1. As superuser, create a group called readers. The password should be * , the gid should be 200 and initially, there should not be any users in this group.
     

  2. Create the subdirectory /home/readers. This subdirectory should be owned by the user root and the group readers. The permissions on this subdirectory should be rwxr-x---. Copy /etc/passwd to /home/readers.
     

  3. On another virtual console, login as alterego. Can you:
    - list the contents of /home/readers? (answer should be no)
    - cd to /home/readers? (answer should be no)
    - cat /home/readers/passwd? (answer should be no)
    - create a file in the directory /home/readers? (answer should be no)
    Logout.
     

  4. As superuser, add alterego and floopy to the readers group. The line in /etc/group should now be: readers:*:200:alterego,floopy
     

  5. On another virtual console, login as alterego.
    Use the "id" command to verify that you are now a member of the readers group.
    What is your gid? _____
    Can you:
    - list the contents of /home/readers? (answer should now be yes)
    - cd to /home/readers? (answer should now be yes)
    - cat /home/readers/passwd? (answer should now be yes)
    - create a file in the directory /home/readers? (answer should still be no)
     

  6. Still working as alterego
    - cd to your own home directory
    - what is your gid? (use the "id" command to determine this) _____
    - use touch to create a new file called test1
    - which user and group own test1?
    - enter the command: newgrp readers
    - what is your gid? (use the "id" command to determine this) _____
    - use touch to create a new file called test2
    - which user and group own test2?
    - logout
     

  7. As superuser, change the permissions on /home/readers to rwxrwx---.
     

  8. Login as alterego.
    - what is your gid? (use the "id" command to determine this) _____
    - cd to /home/readers
    - use touch to create a new file called test3.
    - Who owns test3? Which group owns test3?
     

  9. As superuser, change the permissions on /home/readers to rwxrws---.
     

  10. Login as alterego.
    - what is your gid? (use the "id" command to determine this) _____
    - cd to /home/readers
    - use touch to create a new file called test4.
    - Who owns test4? Which group owns test4?

Copyright © L.M.MacEwan
FLOPPIX Home | FAQ | Download | Labs | ToC | Back |  Next