Questions tagged [setuid]

42 questions
145
votes
9 answers

Running upstart jobs as unprivileged users

What's the canonical way to have an upstart job change its userid and run the script as an unprivileged user? Obviously one can use su or sudo, but this seems hacky (and can generate needless log lines).
aaronsw
  • 1,647
36
votes
5 answers

Can I make a script always execute as root?

How to make a script execute as root, no matter who executes it? I read about setuid but I'm not sure how to do this. I'm using Linux, Ubuntu 12.04 LTS.
15
votes
7 answers

How to run a program as root without "sudo"?

I have a certain binary program on OS X that can only be run as root. I'm tired of prepending sudo each time I invoke it and typing the password, and would like it to automatically run as root when I invoke it regularly, without asking for a…
UrEl
  • 891
11
votes
1 answer

Why does ping require the setuid bit?

In the Jessie version for the Raspberry Pi, ping requires the setuid bit to be set. What is the rationale for this?
u936293
  • 1,337
8
votes
2 answers

"user" CIFS mounts not supported - fedora 30

I have a number of smb v1 shares. (I know that smbv1 is old and vulnerable but I can't change it) Because of the old smb protocol, I cannot use nautilus to open then. Instead, I used fstab entries to mount them. The entries in /etc/fstab look like…
Jounathaen
  • 629
  • 1
  • 5
  • 18
6
votes
1 answer

Why strace sudo command bombs when sudo command works?

my username is allowed to execute sudo command then why does this bomb strace sudo command with the error: sudo: must be setuid root
4
votes
1 answer

What's to stop somebody from creating a setuid-root binary on a flash drive, then putting it into another person's computer and getting root access?

What's to stop somebody from creating a setuid-root binary on a flash drive, then putting it into another person's computer and getting root access? I assume there's some kind of protection against that, but I don't have a spare drive to test…
Sparkette
  • 724
3
votes
0 answers

How to run php script (via web server) as different user under Mac OS X

I'm trying to call an executable from a PHP script that needs to be run as a different user (NOT root) than the web server normally runs as. I thought it should be sufficient to just set the setuid bit on the executable in question, as it is…
Michael
  • 2,824
3
votes
1 answer

How to set permissions on directory, that will bequeath its permissions to all subdirectories?

Is there a way to set permissions on a *nix directory, so that when a subdirectory is created, the subdirectory will be created with all the permissions as the parent directory? There's the following, but it does not seem to do all that I ask…
boardrider
  • 1,213
3
votes
0 answers

iptables, groups and setgid

I have a question about the "owner" module of iptables. I saw that it's possible with it to only allow some programs to use services based on their (e?)gid. On this basis, I can employ the set-group-id bit to change the egid of a program and so,…
Taurre
  • 131
3
votes
2 answers

Android / linux ignores setuid flag

I am trying to get root access to my chinese x86 tablet. With adb I have root. I copied a "sh" binary and set setuid bit, and from adb it works as expected: 1|shell@x98air3g_c5j8:/ $ which su.sh /system/xbin/su.sh shell@x98air3g_c5j8:/ $ ls -al…
Miha
  • 31
2
votes
1 answer

Prompting for sudo password in a setuid root binary

I have a setuid root binary, with_sudo.bin, with the following source code: /* with_sudo.c */ #include #include #include #include int main() { printf("\n\n ruid : %d \n euid : %d \n\n",…
2
votes
1 answer

Why "effective UID" of the process is not changing to the file's owner UID?

I have Ubuntu 20.04 virtual server. I have an executable file script.sh in /opt that has SetUID bit set. meliwex@linode:/opt$ ls -ld /opt drwxr-xr-x 2 root root 4096 Dec 19 03:45 /opt meliwex@linode:/opt$ ls -l total 4 -rwsr-xr-x 1 root root 125 Dec…
Hayk
  • 123
2
votes
2 answers

Sending kill signal using a setuid process results in Operation not permitted

I want to be able to send a SIGHUP signal to a Prometheus process from a CI tool that runs with a different user than Prometheus. Let's say CI uses gitlab-runner user and Prometheus uses prometheus user. I thought that I can achieve sending a SIGHUP…
Ali Tou
  • 121
1
vote
0 answers

Strange behaviour for setuid and setgid

I am doing a small experiment with special privilege bits as follows: [root@localhost~]# useradd user1 [root@localhost~]# cp /bin/touch /home/ [root@localhost~]# chown user1:user1 /home/touch [root@localhost~]# chmod u+s,g+s…
1
2 3