Questions tagged [setuid]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
225 views

suid executibles work only when present in the system PATH

I have an executible which requires root privilages. But it seems to work only when it's present in the system path. When I execute it like this: $ ./prog The program complains of having no root ...
1
vote
1answer
35 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'...
6
votes
1answer
592 views

How do I run a process that wants to become root from a systemd service which is a regular user?

I have a service that I start using systemd. The service user and group are changed to a non-privileged user. [Service] ... User=regular_user Group=regular_user ... At some point the service needs ...
8
votes
4answers
1k views

Howto prevent chgrp from clearing “setuid bit”?

We have RH based Linux images; on which I have to "apply" some "special archive" in order to upgrade them to the latest development version of our product. The person creating the archive figured ...
3
votes
2answers
7k views

systemd permission issue with user root

I'm trying to setup hylafax+ in fedora, either with the rpm file or by source code. hylafax+ is not prepared for systemd, so I wrote i.a. the following file "/etc/systemd/system/hylafax-faxgetty-...
1
vote
1answer
397 views

suid bit in SuSE has no effect through system() [duplicate]

[EDIT: Revisiting this question and seeing it is still wrongly marked as a duplicate] The following question on SE is not a duplicate as it asks about executing bash with the suid bit, which is a ...
2
votes
2answers
2k views

kcheckpass error opening /var/log/faillog

I am seeing the following errors: $ journalctl -b -p3 -- Logs begin at Mon 2016-05-16 21:40:56 EDT, end at Wed 2016-07-27 22:30:13 EDT. -- Jul 27 22:22:26 x99 kcheckpass[5682]: pam_tally(kde:auth): ...
3
votes
1answer
2k views

Why doesn't setuid work with mount?

There is a setuid bit on the file. user@host:~$ ls -l /bin/mount -rwsr-xr-x 1 root root 40152 May 26 19:31 /bin/mount Why does operating system require root access to execute the 'mount'? user@...
6
votes
1answer
262 views

How does sudo work (besides setuid)?

sudo is elevated to root upon launch because it's binary has a setuid enabled. But when I give /bin/login the exact privileges sudo has, and I try to run it from a user that isn't root, I get the ...
4
votes
1answer
100 views

How can I tweak unix settings for 360 Spatial Workstation (specifically the vst and aax audio plugins) to make it run as a non-administrator?

There are free vst and aax (Pro Tools) plugins installed as part of 360 Spatial Workstation. These are greyed-out (as if requiring a license), or invisible (VSTs e.g. in Ableton Live). If you login ...
3
votes
1answer
967 views

why suid bit is unset after file modification

I have an (s|g)uid file world-writable: ls -lh suid_bin.sh -rwsr-srwx 1 root root 168 mai 23 16:46 suid_bin.sh logged with a non-root user account. I use vi (or another editor) to modify "suid_bin....
2
votes
2answers
692 views

ptrace suid binaries after privilege is dropped

I understand that we probably cannot do ptrace on suid binaries. However, I'm wondering why we cannot do ptrace after the binary drops its previlege to uid instead of euid. For example, in the binary ...
9
votes
3answers
548 views

Set-uid executable and resulting process user [duplicate]

In Ubuntu 14.04, the passwd executable is -rwsr-xr-x 1 root root 47032 gen 27 01:50 /usr/bin/passwd and the ping executable is -rwsr-xr-x 1 root root 44168 mag 7 2014 /bin/ping so (for both) the ...
1
vote
1answer
142 views

Darwin strips setuid from interpreter in hash bang execution

This is not exactly a question about how to run a hash bang script. In this situation, a hash bang script exists which doesn't (necessarily) have the u+s permission. Rather, the interpreter has u+s, ...
35
votes
6answers
3k views

What is the safest way for programmatically writing to a file with root privileges?

A huge application needs, at one specific time, to perform a small number of writes to a file which requires root permissions. It is not really a file but a hardware interface which is exposed to ...
6
votes
3answers
1k views

What exactly differentiates the root user from every other user?

What are the fundamental differences between some arbitrary account and root? Is it just the UID being something other than zero? So, what exactly does the su binary do and how does it elevate a user ...
3
votes
1answer
727 views

SUID has no effect on directories with Linux

Why does the SUID bit have no effect when applied to directories in Linux? I clearly see that I can set it with 'chmod u+s'. But why does it not have "any" effect. What is the reason for implementing ...
3
votes
2answers
6k views

Directory permissions “r-s”, chmod 655 does not change to “r-x”, why?

I created a directory in my home directory. and I set its permission as follows: uhmwk.1.4$ chmod 655 dog uhmwk.1.4$ ls -l total 4 drw-r-sr-x 2 s9 s9 4096 Feb 14 21:57 dog why is the group ...
1
vote
2answers
216 views

Changing root's passwords using setuid

Is is possible to change root's password using setuid? What I tried is writing a simple program which calls system("passwd root") owned by root and its setuid bit is set but it didn't work. The ...
-2
votes
1answer
3k views

non-root users can run passwd command as root, why can't they change password of root? [duplicate]

I know about setuid bit on /bin/passwd file which allows us (non-root user) to run that command as root user. running passwd command requires root permissions to change /etc/shadow file. My question ...
1
vote
2answers
6k views

How are setuid, suid, sudo, and su all related? [duplicate]

I have a feeling the setuid bit, the nosuid mount option, sudo, and su are all related given their names. But how do they relate to one another? Are some of them used in conjunction? If they are not, ...
3
votes
1answer
6k views

Effect of nosuid on executables inside the mounted filesystem

Let it be known that I barely understand what setuid/setgid/whatever is. I think it has something to do with what user a program is executed as. This brings me to nosuid. In Security Enhancements in ...
1
vote
2answers
901 views

How to Backup and Compare File Permissions?

Is there a way you can setup a list of receipts of folders and directories of their correct default permissions that can be used as a backup to compare the correct permissions and be used to fix ...
3
votes
1answer
555 views

setuid example from Wikipedia: 4700

I was reading about setuid on Wikipedia. One of the examples goes as follows: 4700 SUID on an executable file owned by "root" A user named "tails" attempts to execute the file. The file ...
1
vote
1answer
187 views

why does setgid permission on an SO cause failures?

When I load a particular version of Python on a server, I get the following error: python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or ...
1
vote
1answer
209 views

Why won't this example of setUID work? [duplicate]

I am learning about setuid and setgid where the user executing the script will inherit the owner's permission while running the script. To test this, I created a bash as user fiverr in /home/fiverr/...
2
votes
1answer
754 views

Why mac os x does not set uid bit for /usr/bin/passwd

A lot of books state that examples of setuid bit usages include passwd, at etc. But in mac os x el capitan, the /usr/bin/passwd does not have the bit set. How could it change the /etc/passwd file?
0
votes
1answer
224 views

Setuid does not work for my windows program hosted on a Linux server [closed]

I compiled ExpressI.exe on a Windows system with Visual C++. The file ExpressI.exe resides on a share mounted from Linux. I need to permit only the program ExpressI.exe to access the test folder ...
0
votes
1answer
275 views

Call setuid On Parent Process

From what I can tell you can only change a parent processes uid by messing with the kernel's address space, is there a better way? If I can only change the kernel's memory, how should I go about this? ...
2
votes
1answer
895 views

How to make new files have 0664 permissions rather than 0644?

I have a directory of subdirectory and files, with the files' permissions set at 0664. The directory and subdirectories are set at 2775, so all new files made have the same group set as the directory....
1
vote
2answers
54 views

User verification

Suppose I've writen a setuid root executable and I want it to verify that the user is not a script by asking the user to provide his/her password (granted, users might save their password and use that ...
1
vote
2answers
671 views

Wrong eUID in `/proc/PID/status` when SETUID is used

While doing a wargame challenge, I ran into an issue with permissions. The info given by /proc/PID/status is not in adequation with the permissions that should be given to the processus. I am user ...
2
votes
0answers
35 views

Sed is unable to copy temporary file to original file [duplicate]

My aim is to edit the file (whose owner is user1) using a script where user2 doesn't have permission to directly edit the file but it should be edited when executed through script by user2. So I set ...
1
vote
1answer
2k views

Using find -perm to find setuid files

I want to find list of all suid binaries. I use the command find / -perm 4000 However this does not give me any output. I understand that the SUID file may be in 4xxx permission mode. But if I issue ...
1
vote
1answer
345 views

How to run a setuid program on Solaris 10?

I have a Solaris 10 system: # uname -a SunOS edddev03 5.10 Generic_150400-04 sun4v sparc SUNW,SPARC-Enterprise-T5120 I wrote a program printing the uid: # cat getuid.c int main (void) { printf ("%...
3
votes
2answers
2k views

How to start (or find) a process with RUID different from EUID?

Inspired by one of the previously answered questions, I tried executing a program by a user who was not its owner -- and the process's RUID and EUID remained the same. (Unless I read the answer wrong ...
6
votes
1answer
2k views

No output from locate command

I usually find the answers to all my Unix related problems already posted as questions and answers. However, this particular issue has had me stumped for the past hour so I thought I’d ask my first ...
3
votes
1answer
3k views

Setuid, SUID bit not providing root privileges

I've written and compiled a short program to allow any user to change the contents of my /sys/class/backlight/intel_backlight/brightness file, but I fail to escalate their permissions. What could I be ...
-1
votes
2answers
1k views

How can I identify if a binary file is set-user-ID? [closed]

In Linux, how can I identify if a binary file is set-user-ID? Can I use ls -l?
24
votes
1answer
28k views

Difference between owner/root and RUID/EUID

I am relatively new to the concepts mentioned in the question and reading about them from different sources only makes them more confusing. So this is what I understood so far: When we are given ...
0
votes
1answer
250 views

Not able to write a file when in the same group using PHP posix_setuid()

I'm running a PHP process from root which calls posix_setuid(1500); and then tries to open a file output.log The ls -l output.log shows this output: -rwxrwxr-x 1 www-data www-data 2294376 Mar 19 ...
0
votes
2answers
317 views

Why is the suid bit having no effect on a shell or perl script? [duplicate]

As an experiment in playing with the suid bit, I tried writing a script to run apt-get update from a bash script, and then set the suid bit on it, so I could just run ~/update or something. apt-get ...
1
vote
5answers
2k views

setuid (and other) permissions lost when copying / elsewhere - what to do?

I sort-of-cloned an existing Debian 7.x distro by copying the contents of the root filesystem (not the special dirs of course) to another HDD. I booted, things seem to run, but - I get some weird ...
4
votes
2answers
745 views

linux setuid does not work

I am learning linux suid,so I have written a small c program with the following content to test it #include<stdio.h> int main(){ system("echo 100 >> test.txt"); return 0; } -rwsr-xr-x 1 ...
0
votes
2answers
10k views

Adding setuid permissions to a file

I am hosting a php application on my CentOS 5 server. The application runs some commands via a ssh file called openmgr. For that I want to give a permission of -rwsr-xr-x to the file. I tried chmod +...
1
vote
1answer
2k views

How to enable a non-root user to empty the linux buffer cache

I'm required to empty the linux buffer cache in a python script, that runs on a Debian wheezy VM. As root I run sync; echo 3 | sudo tee /proc/sys/vm/drop_caches, but the script is run by a user, ...
0
votes
1answer
1k views

crontab not executing my script?

I added this rule to the bottom of my crontab * * * * * /root/test.sh It basically resets iptables so I can fool around. If I mess up I won't be locked out of my box. When I run the script in bash ...
4
votes
1answer
754 views

Security of capabilities vs setuid (LD_PRELOAD, etc)

I know that if a process is run setuid that it's protected against various things that could subvert the process, like LD_PRELOAD and ptrace (debugging). But I haven't been able to find anything on ...
45
votes
2answers
48k views

Using the setuid bit properly

I have a process that needs root privileges when run by a normal user. Apparently I can use the "setuid bit" to accomplish this. What is the proper way of doing this on a POSIX system? Also, how ...
2
votes
2answers
3k views

print the /etc/shadow file in the console

How do I change the permissions of an executable file to access the /etc/shadow file? So far I have the following bash script: #!/bin/bash gcc print.c -o print chmod +s print ./print exit 0 and ...