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.
41 questions
0 votes
3 answers
122 views
Keeping owners in a folder copy
I'm trying to copy a folder (SRC) containing some files and subfolders. The content and SRC itself have setgid bit enabled (that is the s in place of the x in the group triplet). Furthermore, the ...
0 votes
0 answers
52 views
Set group and mod of a new directory
I try to set for NEW created files/directories in /home/test: group to "test" right to "770" This works for the group (1). chown :test /home/test chmod g+s /home/test But I do ...
0 votes
1 answer
852 views
Inherit ownership and permissions to directories and files
I have a directory test with the owner user:group and 770 as permissions. I want, that every directory and file within test do have the same specifications. I tried chmod g+s,u+s test, which partially ...
1 vote
1 answer
555 views
podman running as user dies after hard reboot - Method gave invalid 400 URI Failure message: Failed to setgroups - setgroups (22: Invalid argument)
I'm struggling to determine what is going on here. Podman running in user space was running fine, but the server took a hard reboot and now it is... for lack of a more accurate technical assessment, ...
3 votes
2 answers
342 views
Why is /var/mail setgid?
I am learning about UNIX file permissions and I saw that on my Ubuntu system, /var/mail has the setgid bit set. Why is this? $ ls /var/mail/ -dl drwxrwsr-x 2 root mail 4096 Feb 23 05:57 /var/mail/ ...
1 vote
2 answers
246 views
SUID bit ignored when creating files / directories
I've set the SUID & SGID bit on a folder belonging to user foo with sudo chmod g+s myfolder & sudo chmod u+s myfolder drwsr-sr-x 24 foo www-data 4,0K Okt 25 16:17 myfolder Then I went inside ...
0 votes
1 answer
283 views
Shared directory with setgid not working as expected
I have a group of developers who want to share the same directory. I created a new group with these developers and created a directory for them. On that directory, I set the group to the group I ...
0 votes
0 answers
196 views
I have an Apache2 CGI executable trying to use setgid()/setuid(). But it fails switching to root. How do I fix that issue?
My CGI executable starts as expected. At some point, though, it tries to become root (and then yet a different user). At that point, the CGI fails. Here is the pertinent code snippet: [...] int const ...
1 vote
1 answer
2k views
Is appropriate to use setuid() over setresuid()/setreuid()/seteuid()?
I have an executable binary which was compiled from a C source file The executable has the setuid permission on I noticed that, if the owner of the executable is root, I can use setuid(geteuid()); ...
3 votes
2 answers
1k views
Why I can't set the setuid for "others"?
I can't set other's setuid bit. Why? Is there some security lock? $ ls -l -rwxrwxr-x 1 allexj allexj 16784 Mar 11 17:30 a....
2 votes
1 answer
550 views
Why "permission denied" when running `less` with chmod 6110?
Assume you are user x, so running id gives uid=1001(x) gid=1001(x) groups=1001(x) And there is also a user y with uid=1002(y) gid=1002(y) groups=1002(y) Now as root we create a file readme in user's ...
3 votes
0 answers
519 views
Using umask vs. setgid: best practice for peacefully sharing a directory in a Linux users group?
What is the best way to share a directory between multiple Linux users? Say I have a directory at /foo (a regular directory no NFS or else) and a bunch of users added to the group bar. What I want is ...
2 votes
1 answer
5k views
What does "is set-group-ID on execution - ignored" mean, and why am I unable to uncompress a file because of it?
I'm trying to uncompress a file using gunzip GCF_000746645.1_ASM74664v1_genomic.fna.gz ... but I get the following error: gzip: GCF_000746645.1_ASM74664v1_genomic.fna.gz is set-group-ID on execution -...
1 vote
3 answers
2k views
rsync not setting stickybit / GID bit
Using the following rsync command, the RWX permissions are being correctly set for both files and directories but the sticky bit options are not. rsync -rtvz --partial-dir=.rsync-partial --chmod=Da+t,...
0 votes
1 answer
858 views
How to access/set other user's environment variables after setregid() and setreuid() in C
I have a privileged C program that is executed by a standard user (say stduser) and on execution switches to a system user (say sysuser) as follows. Basically, I am trying to do something similar to ...