Questions tagged [setgid]

setgid is a bit that can be set in the filesystem. If an executable is setgid, then when that executable is run, the spawned process will have an effective group id (EGID) of the group owning the executable, instead of the group of the user running it.

0
votes
0answers
26 views

Permission setup for two different groups of users in the same directory

I need to find the optimal permissions layout for the following use case: There is a AIX machine used for collaborating on software projects. Each project has its own sub-directory. For each project,...
0
votes
0answers
39 views

Applying special permission suid & sgid

I was in the processs of learning a bit about the special permission in Linux. Where is find certain anomilies. suid - For executable/files where user subsume the UID/permission of the owner. With ...
1
vote
1answer
546 views

Why is chmod g+s on a directory being ignored?

I have a git (actually git-annex) repository I'm trying to make shared, part of which involves setting the set-group-id bit on several directories. This is on a Debian GNU/Linux Stretch box, on an ...
3
votes
2answers
799 views

setgid: chmod g+s,g-x on executable

I'm not understanding setgid on executables on my platform (ubuntu). g-x,g+s is not giving the process effective group permissions of the program's owner. $ gcc perms.c -o perms; ls -l ; ./perms -...
0
votes
2answers
756 views

Can't set group ID bit on directory

I have created a directory called newDir and changed the group it belongs to with mkdir newDir && chgrp test-group newDir. I was user me when I did this. Calling stat newDir produces ...
0
votes
1answer
1k views

Samba shared folder with setgid problem

I am setting up a file server with a shared directory. Inside, there are per-user folders that are readable by any user and a shared directory that is readable and writeable by any user. The per-...
1
vote
1answer
329 views

Linux open() syscall and folder permissions

I have a process P which is spawned by a process owned by root. After P is created setguid() and setuid() are called and it runs as user U. The process P attempts to create a file f on a folder F (in ...
2
votes
2answers
501 views

Unset setgid bit with chmod numeric mode

I've just noticed some interesting behavior with chmod when unsetting the setgid bit: $ mkdir test $ chmod 2755 test $ stat -c '%a %n' test 2755 test # as expected $ chmod 0755 test $ stat -c '%a %n'...
0
votes
0answers
261 views

SETUID and SETGID Behavior

The setup: ~$ ls -l /etc/sudoers -r--r----- 1 root root 614 2017-09-10 20:29 /etc/sudoers ~$ ls -l /etc/shadow -rw-r----- 1 root shadow 794 2011-04-18 11:49 /etc/shadow $ ls -l $(which ht) -rwsr-sr-...
1
vote
2answers
353 views

How to call chmod and preserve the SGID bit?

I have the following directory structure: + public/ |-+ pics/ | |-- a | `-- b `-+ thumbs/ |-- a `-- b I would like all the files in the tree to be owned by gallery:http with ug=rwX,o= mode set. ...
0
votes
2answers
538 views

How to set setgid bit for a program to allow it change its group folder?

The preconditions are somewhat complex, so here is the context: There is a program, that is launched through a shell script; The shell script launches the program through a .jar file; I want this ...
3
votes
2answers
691 views

Meaning of setgid on an executable

I get that setuid on a binary executable allows the process to get the effective uid of the binary owner. What I cannot understand is what if setuid bit is off but setgid bit is on for a particular ...
1
vote
1answer
34 views

Do I need to set uid bit in this case?

I have modified xlockmore source to add a feature I needed, but it is unable to read the shadow password file and is asking me to set uid or gid bit on the binary. But the official binary I use doesn'...
3
votes
2answers
2k views

setgid sticky bit not working

I have yet another frustrating problem. I have a group of users belonging to the "testing" group. I have a folder located at /var/log/projects with the setgid bit set. This is so any new files or ...
0
votes
0answers
337 views

scp file to remote server prevent delete

A team want to implement a crude file dump backup solution to be used by multiple hosts. They have a remote user on the backup server backupusr that they can SSH/SCP with, with SSH keys setup. The ...
1
vote
1answer
335 views

Share files/directories by setgid

To allow write access to a specific group, shared files/folders can be made writeable by default for everyone in this group and the owning group can be automatically fixed to the group which owns the ...
40
votes
4answers
114k views

'chmod g+s' command

Hello I want to understand the role of the chmod g+s command in Unix. I also would like to know what it does in this particular context: cd /home/canard; touch un; chgrp canard .; chmod g+s .; touch ...
1
vote
2answers
2k views

Why the S_ISUID and S_ISGID mode bits got cleared when the owner or group of an executable file are changed by an unprivileged user

I was reading the man page of chown. I don't understand why S_ISUID and S_ISGID mode should be cleared when the function returns successfully.
5
votes
2answers
1k views

Why ssh-agent group ownership is not root

Trying to understand why ssh-agent has sgid bit and found this post ssh-agent has sgid I have another question, why the group ownership of ssh-agent is nobody not root? What is the reason behind it? ...
1
vote
0answers
109 views

Limit program execution to a list of arguments

I would like that my Unix users can only run a specific command insecurecommand with a controlled list of arguments stored in a file. The only solution I have found at this time is to : Create a new ...
10
votes
2answers
4k views

Group memberships and setuid/setgid processes

Processes which de-escalate privileges via setuid() and setgid() do not seem to inherit the group memberships of the uid/gid they set. I have a server process that must be executed as root in order ...
3
votes
1answer
414 views

setgid binary doesn't have permission, mount's right, I'm missing something, but what, please?

I've checked the manpages, the mount, the permissions ... (edit: combined history into one sequence as requested. Starting to seem a not-simple problem. Nothing new since last edit, just bundled up ...