Find the answer to your Linux question:
Results 1 to 2 of 2
I don'tknow if it is the correct category to post this post, but what is the difference between newgrp command and role? Does it differ or not? For example, in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2013
    Posts
    12

    difference betwen newgrp command and roles


    I don'tknow if it is the correct category to post this post, but what is the difference between newgrp command and role? Does it differ or not?
    For example, in a System V-based UNIX system, in which a process can have exactly one group identity, and in order to change groups users must execute the newgrp command.
    Do these groups differ from roles?
    does my question make sense?

  2. #2
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    645
    Quote Originally Posted by dksellou View Post
    I don'tknow if it is the correct category to post this post, but what is the difference between newgrp command and role? Does it differ or not?
    For example, in a System V-based UNIX system, in which a process can have exactly one group identity, and in order to change groups users must execute the newgrp command.
    Do these groups differ from roles?
    does my question make sense?
    The permission (at file/directory level) has a three tier set of permissions. The first is the permissions for the user ownership, the second level is group (a user can belong to one or more groups at the same time) ownership. The final tier is for those users that are not in the owner, or in the the owning group and is often referred to others. If course Unix/Linux has ACL capability as well (but usage is not very often).

    The command, id, will show you your user name (and the uid, the number that user name) and all the groups (and the gid, the number assigned for that group) with the first group in the list being your "primary group".

    A way to think about these tiers of access are like an "apartment complex". The owner layer is like your apartment. You don't want every body just walking into it. Your apartment building may have a "laundry room" that is accessible by all the building residents (group access). The complex might have a "game room" which can be used by all renters in the complex (another group). The "Sales Office" wants to allow anyone to enter its office (assume manned on a 24/7 model) so they set the "other permission" to anyone.

    At each one of these tiers, the file permissions are a combination of (read, write, execute). You need both read and execute permission to run a program. The system first checks if you are the user that owns the file, then the user permission provides the needed permissions you have access, if not then it checks to see it your user is a member of the group that owns the file and if so the group permission set and if that has the needed permissions, access is granted. If both user and group access has not provided access, then the permissions for the "others" is checked and if that provides access needed you are given access to the file. Directories (folders) use the EXECUTE permission as you have browsing access within the directory (you do not need to know the file name as you can do "ls" in that directory or use tab completion or see the contents in a GUI based file browser).

    After you understand the permission access, and are very conformable with them and the "chmod", "chown", and "chgrp" commands, you will then need to research the "sticky bit" (one for user, group, and other).

Posting Permissions

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