2

Linux kernel supports the traditional concept of a Unix user.

Every user-space process has a user owner.

Every user-name has corresponding userid in kernel. Kernel does not know user-name.

Groups are sets of users. The primary purpose of groups is to allow a user to share file access to other users in a group.

If non-root users, user1 & user2, are not in same user group(say developer), then, user1 cannot modify the files/directories owned by user2.

If non-root users user1 & user2 are in same user group(say developer), then, user1 can modify the files/directories owned by user2.


Question

If user1 & user2 are in same group, then,

Does kernel allow user1's process to send any signal(say SIGKILL with kill command) to a process owned by user2?

  • If the two users are in the same group, they still can't modify each other's files, unless the files are writable by the group. – Kusalananda Mar 23 '17 at 8:06
  • @Kusalananda A non group user cannot atleast(read) the file of other user. A group user can access the file based on group permissions. Is that correct? – overexchange Mar 23 '17 at 8:11
  • Any user can access (read, write) any other file based on the permissions on the file. If a file is group readable, then the group can read it. If it's readable by "others", then anyone can read it. Likewise for writing. – Kusalananda Mar 23 '17 at 8:43
4

POSIX says:

For a process to have permission to send a signal to a process designated by pid, unless the sending process has appropriate privileges, the real or effective user ID of the sending process shall match the real or saved set-user-ID of the receiving process.

so no. The sending process needs to be privileged (root) or the UIDs must match.

  • When it says, For a process in your answer, if I run kill <pid> command on command prompt, is it a shell process sending kill signal to some pid? – overexchange Mar 23 '17 at 1:57
  • Yes -- kill is a builtin in common shells. (You can also explictly run /bin/kill in which case a new process will be spawned for it.) – PSkocik Mar 23 '17 at 2:01
  • So, any non-root user process1 can send signal to only same non-root user process2. Is that correct? – overexchange Mar 23 '17 at 2:04
  • 1
    Assuming both users in same group, user1 can modify files/directories owned by user2, but user1's process cannot send signal to a process owned by user2. Tricky – overexchange Mar 23 '17 at 2:11
  • 1
    @overexchange This is a different question and you should post it as such. :-) There can be only one root user because there can be only one user with UID 0, and this is defined as root by the kernel. But then you have capabilities. Any process with capability CAP_KILL can signal everybody else. – lgeorget Mar 23 '17 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.