Questions tagged [setuid]
The setuid tag has no usage guidance.
38
questions
2
votes
1
answer
775
views
How to give partial user access to systemctl without sudo/su/root
I'm a bit new to this, so I'm not sure where to look.
I have access to a server that as a command that executes a limited version of systemctl, and I want to expand it.
The command acts as follows:
It ...
0
votes
1
answer
183
views
setuid does not work with standard user account
Look at this c program:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
printf("UID: %d\n", getuid());
printf("EUID: %d\n", ...
0
votes
0
answers
250
views
Using setuid in a Shell Script on Ubuntu 20.04
So I have a Laravel PHP app on Nginx on Ubuntu 20.04. I have a simple deploy.sh script that will:
Put Laravel into maintenance mode, so it returns a 503 error if anyone visits the site
Pulls down the ...
1
vote
0
answers
217
views
RHEL8 Limits not applied when setuid is configured
I have configured my limits.conf file to allocate a huge stack size
* soft stack 65535
* hard stack 65535
ulimit -s shows the correct value for both root ...
0
votes
1
answer
143
views
setuid not working as expected
I have a node js script that listens on a certain port.
If this script receives a json file it needs to execute a deploy script in a users home dir.
The node script runs under node_user.
The ...
0
votes
1
answer
276
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 ...
2
votes
0
answers
716
views
Best practice for setuid and setgid in /root and user directories
ZFS allows to created datasets with setuid turned off, which (AFAIK) means that setuid bit can't be set on files stored in those datasets.
Assume now that there are two datasets, one for the /root ...
0
votes
3
answers
314
views
Is there a way to allow an apache2 logged in user to access a specific directory dynamically?
This is surprisingly a very difficult problem to solve.
I want to allow my Linux users to login to Apache2 and have access to their own directory(ies) only. I've managed to get Linux users to ...
0
votes
1
answer
789
views
How to rsync to remote machine with user1 for ssh and user2 as remote rsyncer?
UPDATE:
it seems I have to use rsync modules. So I created a very simple rsyncd.conf in the home of user2 on the remote server with:
[test]
path = /dest
It does not work, but the problem seems ...
0
votes
0
answers
336
views
Elevated privileges for non-modifiable install script
I need to give permission to a local user to run an installation script that requires root privilege. So I created a special group in which this user is a member of and gave the permissions to the ...
1
vote
2
answers
2k
views
Apache Per-user web directories under user's own ID instead of www-data?
Talking about this feature
http://httpd.apache.org/docs/current/howto/public_html.html
Is there a way (HOW?) to have Apache take on (setuid) the ID of each "~user", instead of doing everything under ...
9
votes
1
answer
2k
views
Why is chroot system call not available to non root user?
I was reading description about setuid on wikipedia
http://en.wikipedia.org/wiki/Setuid
I was unable to understand how chroot is related to setuid as mention in following paragraph from wikipedia
...
2
votes
1
answer
544
views
Is the following setuid program a security risk?
I have the following program in .c set as setuid chmod only read/execute by owner and will set it immutable, as i will the php script it invokes.
#include <stdio.h>
#include <stdlib.h>
#...
2
votes
1
answer
986
views
Amazon EC2 Ubuntu and upstart logging permissions
I have set up this upstart script on a Amazon Ec2 Ubuntu 12.04 TLS instance for executing a node.js application. The script uses setuid and setgid.
It works fine without using setuid and setgid but ...
1
vote
1
answer
677
views
SETUID / SETGID on a binary executable stopped working following upgrade of Fedora Core
I have a C program that needs access to a protected directory full of stuff.strong text The idea is that only the program or the administrator have access.
In the past on Linux platforms, I've used ...
5
votes
1
answer
1k
views
Linux 2.6.32 Centos 6.4 setuid() fail / security changes?
After recently updating to CentOS 6.4, two machines have setuid() restrictions which act like either capabilities or selinux, however both are disabled. E.g. the following fails:
[root@host statd]# ...
0
votes
1
answer
2k
views
Prevent setuid from dropping setcap user privileges (VirtualBox)
I'm trying to run a web server from a headless, NAT'd VirtualBox guest. VirtualBox needs to bind to port 80, but the only way to do so is by running VirtualBox as root. To get around this, I tried ...
1
vote
1
answer
2k
views
Unable to su into any user
After I have fiddled with the folders /usr/bin, /usr/lib and /usr/lib64 I restored them, but was not able to su into root (and probably other accounts too):
Permissions on the password database may ...
3
votes
3
answers
4k
views
What's the safest way to kick off a root-level process via cgi on an Apache server?
The problem: I have a script that runs periodically via a cron job as root, but I want to give people a way to kick it off asynchronously too, via a webpage. (The script will be written to ensure it ...
2
votes
1
answer
207
views
How to start/stop service with Apache2 on Ubuntu
Using Apache, I'd like to be able to start and stop a service on the same server. Essentially, I'm looking for a way to allow Apache (or some script called by Apache) to call sudo service XXXX start.
...
2
votes
0
answers
392
views
checksecurity / setuid changes, is this a bug or did somebody break in?
I received a mail by checksecurity from my ubuntu 12.04 server with the following content:
--- setuid.today 2012-06-03 06:48:09.892436281 +0200
+++ /var/log/setuid/setuid.new.tmp 2012-06-17 06:47:...
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 ...
1
vote
2
answers
4k
views
SETUID Permission Denied
I have been learning Linux from few days, and now I was trying to learn the advanced file permissions like setting UID, GID and sticky bit.
At root I have first changed the ownership of directory to ...
6
votes
4
answers
11k
views
sudo: must be setuid root (Mac OS X)
I ran
$ sudo chown -R $USER /usr/bin
and now when I try to run programs under the /usr/bin path as sudo I get
sudo:must be setuid root
What should I do if I would like to revert the chown?
4
votes
3
answers
17k
views
Cannot write to CIFS share as non-root user - CentOS 6
I'm working on a system recently migrated to CentOS 6 from CentOS 4.9. There is a CIFS mount from a Windows 2008 server that existed on the old system. The raw mountpoint has 777 directory permissions....
3
votes
2
answers
4k
views
Upload only SFTP with OpenSSH and Linux?
I'd like to set up a chrooted SFTP server with upload only privileges.
Back in the day, I know I've done this with FTP on FreeBSD through the use of SETUID. All uploaded files were automatically ...
2
votes
1
answer
2k
views
When is appropriate to remove setuid/setgid privileges from an app?
I've been skimming through the NSA suggestions for hardening Mac OS X and Linux and noticed this little tidbit of info:
Setuid programs run with the privileges of the file's owner (which is often ...
1
vote
4
answers
8k
views
How to make default owner for all files and directories in folder
I want all new files created in one folder to have an owner called user1
How can I do that?
3
votes
1
answer
613
views
Selective setuid root or running an application as root ? (web server/cgi context)
Well we have an in house server manager (like Webmin, only more specific), comprising of a bunch of C CGI programs and CGI Perl scripts, some of which require root privileges (adding system users, ...
0
votes
1
answer
4k
views
How does MySQL run as user "_mysql" on Mac?
On Mac, MySQL seems to save data as the "_mysql" user. Can somebody please explain how this is achieved. I would have expected the MySQL server application (mysqld) to have the setuid flag set, so ...
2
votes
2
answers
3k
views
Adding a new user into linux from a script
I am using a customized Redmine installation to manage projects. I have managed to hook the addition of new users and send the login information to a bash script I have. Below is my script:
#!/bin/sh
...
6
votes
3
answers
5k
views
sudo or acl or setuid/setgid?
for a reason I do not really understand, everyone wants sudo for all and everything. At work we even have as many entries as there are way to read a logfile (head/tail/cat/more, ...).
I think, sudo ...
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 ...
6
votes
5
answers
27k
views
(Ubuntu) setuid bash doesn't work
Here is the code:
(root:)
# mkdir /test
# cp /bin/bash /test/sbash
# chmod a+s /test/sbash
(user1:)
$ cd /test
$ ./sbash
$ mkdir trycreate
mkdir: cannot create directory `trycreate': Permission ...
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 ...
8
votes
4
answers
11k
views
Set uid for windows
Is there an equivalent of set uid for windows(XP)? The 'run as' option requires admin password each time it runs. I want users to be able to run that particular executable without knowing admin ...
3
votes
4
answers
21k
views
Mapping UIDs for NFS
I have a Mac OS X file server that serves via SMB/CIFS and AFP. The server is a domain client via the golden triangle approach, but this results in a very large UID for the users. This is fine for ...
5
votes
1
answer
5k
views
How do you run a PHP script as the file's owner, rather than as the webserver user?
I'm sure there's a well-known answer for this, but I can't seem to find it.
How do I make a user's PHP scripts (in ~user/public_html, for example), run as the owner rather than as (eg) www-data?
...