Questions tagged [setuid]

196 questions
13
votes
4 answers

How do real and effective user IDs work?

When a normal user wants to make change to the passwd file, the user will by setuid be given the effective user access. User becomes root temporarily and can edit passwd. However you can only edit your password right, and not everybody else? However…
starcorn
  • 457
8
votes
3 answers

SetUID bit not working in Ubuntu?

I suppose an executable file with SetUID bit set should be running as its owner but I cannot really reproduce it. I tried the following. $ cat prepare.sh cp /bin/bash . chown root.root bash chmod 4770 bash # Verified $ sudo sh prepare.sh $…
iBug
  • 3,508
2
votes
2 answers

suid executable not elevating permissions but `sudo` does elevate

I'm trying to write a program that will quickly shut down a laptop without prompting for a password or confirmation. The laptop is running Linux, specifically Manjaro. To that end, I'm trying to make a setuid executable called downnow that executes…
Greg Nisbet
  • 3,076
2
votes
0 answers

Setuid program loses group memberships

I am upgrading an older SuSE-13.2 box to Leap-15. I have done a fresh Leap-15.0 install and ported over the source code that we ran on the 13.2 box. I builds fine but I am having an issue. The program is/has to be an suid program. It also uses…
markh
  • 21
1
vote
0 answers

setuid confusion, change owner of files created to particular user:group

I am trying to setup a directory /opt/www in such a way that when a user who belongs to the group django creates/modifies files and directorys within, they are set to owner django and group django. I have looked at setuid and setgid confusion and…
0
votes
0 answers

setuid doesn't work in /tmp

I wrote a C program, expecting to see the difference between uid and euid with setuid bit enabled: #include #include int main(void) { printf("euid: %d\n", geteuid()); printf("uid: %d\n", getuid()); return 0; } Then…
z.h.
  • 994