Questions tagged [suid]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
69 views

SUID bit disappearing from a program

I maintain a bunch of Debian 11.8 servers and recently something weird has started happening. The SUID bit has started disappearing from a program on all servers roughly at the same time. For example, ...
user avatar
1 vote
2 answers
1k views

how to make a shell execute with suid

I'm trying to suid a shell and it's not working. I need help understanding why, and how to fix it... I'm following these steps (as root) cp /usr/bin/bash /usr/bin/bash-emergency chmod 4755 /usr/bin/...
mikem's user avatar
  • 460
0 votes
1 answer
64 views

I'm trying to provide limited access to certain functionality using links, bash scripts and SUID. SUID script does not run with root access

EDIT: this Sticky bit enabled Script can't write to a root file appears to be a similar problem EDIT: How can I use SetUID on a shell script to run as a non-root user? is very similar as well. I ...
FIREBAAT's user avatar
0 votes
1 answer
34 views

Group of new file created by the webserver is always set to sudo

I am running a magento 2 project on Apache 2 Webserver. There is a logfile folder at var/log I have set the permission, user and group of the folder to drwsrwxr-x 2 company www-data by using chmod ...
Black's user avatar
  • 491
0 votes
1 answer
355 views

Sticky bit enabled Script can't write to a root file

I have 2 files in the /tmp/. The first one is an empty file named "file" with permission -rw------- and owner root:root. The second file is named "script" which is a simple Ruby script with ...
15 Volts's user avatar
  • 287
1 vote
1 answer
387 views

Why /proc has nosuid on Ubuntu

I notice /proc and /dev is mounted differently on ubuntu than other linux distribution as follows: Ubuntu: udev on /dev type devtmpfs (rw,nosuid,relatime,size=4079136k,nr_inodes=1019784,mode=755) ...
Alex's user avatar
  • 11
4 votes
2 answers
7k views

Allowing nagios plugin check_dhcp to work without setuid root

Nagios has a plugin, check_dhcp, that does exactly what you'd think. It's widely suggested to install it setuid root, because it uses SO_BINDTODEVICE, which usually only root can do. Of course a ...
Phil Frost's user avatar
1 vote
1 answer
165 views

Is runing script with SUID bit set up work the same as runing same script with sudo (or root)?

I wanna run some script with root priviliges but by apache user. So I added SUID bit to script file but this doesn't work as I expected. Script file owner is root. rwsr-xr-x 1 root root 2438 paź ...
B14D3's user avatar
  • 5,258
1 vote
3 answers
1k views

Running svnsync on a repository with group suid/sgid set fails to execute a hook

I have a Linux server that I am attempting to run svnsync against a list of repositories to mirror / back up. I created a folder /srv/backups and set it to have the group gsid of adm, using chmod g+s ...
Damon's user avatar
  • 131
5 votes
1 answer
7k views

How can I use SetUID on a shell script to run as a non-root user?

Our company's server is running Ubuntu 12.04 (Precise) and Apache 2. We have a custom, internal web application installed. I have a bash script which pulls any updates to that app from source control ...
Jazz's user avatar
  • 153
1 vote
1 answer
175 views

smbd won't start or stop when user is elevated to root by SUID bit

Under Ubuntu 12.04, I've written the following C program to help me shut down my server's apache2 and samba services while I run automated backups. Notice that in the Makefile I'm setting the SUID bit ...
Isaac Sutherland's user avatar
0 votes
1 answer
237 views

How to SUID? Shellscript, Perlscript, Binary-Wrapper?

I just read some articales about suid. lets say i need the helpdesk to be able to change customer passwords. it would be good if i could execute a ruby script that checks the db if the user is a ...
baj's user avatar
  • 139
3 votes
3 answers
392 views

Problems with SUID

I have a simple command that I want to be able to perform as a user, but it requires root permissions. I suspect that this is a case for the "SUID"-bit, but I've never used it. This is what I've ...
aioobe's user avatar
  • 391
0 votes
1 answer
411 views

PHP Security: Need help understanding SUID

I am reading a book about PHP Security and there's the below I do not really understand, specific part in bold. So say PHP want to move a file that belongs to user A, PHP has to run as user A? Is that ...
Jiew Meng's user avatar
  • 241
1 vote
4 answers
2k views

find / -perm -4000 -o -perm -2000 > suid.. help with bash script to run nightly.?

help me with this this problem. so far i have "find / -perm -4000 -o -perm -2000 | xargs ls -l > suild.list" argument that i want to write as a bash script. I would like to write this as a bash ...
user avatar
2 votes
1 answer
2k views

Running a shell script with its owner's privileges

On a Debian (5.0.3) server I have a user svnsync who owns a certain shell script: -rwsrwsr-x 1 svnsync users 119 Dec 21 13:45 mirror-svn.sh I'd like everyone in the users group to be able to ...
Jonik's user avatar
  • 3,021
0 votes
5 answers
3k views

Setuid not working on Solaris

I have a Perl script marked setuid, but when I run it, it says I don't have permission to do so. I am running Solaris 10. This works on another system but I can't tell whats different. What am I ...
Eric Johnson's user avatar
59 votes
8 answers
270k views

Run a shell script as a different user

What's a good way of running a shell script as a different user. I'm using Debian etch, and I know which user I want to impersonate. If I was doing it manually, I would do: su postgres ./backup_db....
Wadih M.'s user avatar
  • 1,042
15 votes
3 answers
7k views

Cannot Set UID on Shell Scripts

Can anyone help me find out what is going on here? I have some rules set up tracking packet counts. When I run the following script as root: #!/bin/bash iptables -t mangle -xnvL I get the output I ...
Tom Ritter's user avatar
  • 3,267