Questions tagged [suid]

Use [suid] only for the suid/nosuid option of mount. Use the more general [setuid] for questions about the setuid/setgid mechanism in Unix.

Filter by
Sorted by
Tagged with
0
votes
1answer
32 views

How can I verify that a file is being execute as root account?

Let's say we have created a file with root account with -rwsr-xr-x script.sh permissions. We have set suid bit on this file so any user who is gonna execute this file, it's gonna be execute by owner ...
0
votes
1answer
30 views

Any reason for specifying -type f in find when looking for files with SUID bit set?

What's the reason for using -type f with find / -perm -u=s -type f 2>/dev/null. I see this all over the Internet and don't understand why to specify the type as regular file if look for SUID bit ...
1
vote
1answer
108 views

Common binaries with support for command execution, like `awk` and `vim`, not respecting setuid bit?

I'm hardening a Linux system and wanted to test (setuid-based) shell escapes using common binaries, like awk, vim, etc., supporting command executing. However, all binaries I've tested except sh and ...
0
votes
0answers
47 views

Run a script as root with SUID [duplicate]

I created a simple script on Ubuntu Server 18.04: #!/bin/bash apt update apt upgrade then I changed the owner to root # chown root update.sh then I added SUID bit and execution bits for user and ...
1
vote
1answer
78 views

does nosuid work on bind-mounts to suid partitions?

if i have /target mounted with suid and then make a bind-mount on /bound with mount -o bind,nosuid /target /bound, will nosuid take effect on /bound ? (imo it should take effect but i'd still like a ...
2
votes
1answer
966 views

Why doesn't setuid() work with non-root users?

I'm experiencing a weird behavior regarding setuid() and the setuid bit. It seems like the suid bit and setuid() do not work as expected. I am expecting for a binary with +s and owned by uid 1001 ...
3
votes
0answers
22 views

How to create a directory behalf on root user? [duplicate]

I have a script: [postgres@LaHarch ~]$ cat mkrundir.sh #!/bin/bash mkdir /run/postresql With attributes: [postgres@LaHarch ~]$ ll mkrundir.sh -rwsr-sr-x 1 root root 74 Aug 26 18:53 mkrundir.sh ...
3
votes
2answers
290 views

What does it mean for a folder to have suid permission? [duplicate]

I know what it means for a file to have suid permission. It means when other users have execute permission for it, they execute as the owner of the file. But what does it imply when a folder has suid ...
1
vote
0answers
30 views

Need to run scripts/commands with root privileges for user selfservices

The core of the topic is a very a common but I am not satisfied. I have a script looking for a pid and running the kill command on the pid if found. So I chown the script to root.root and add 4755 ...
0
votes
1answer
43 views

How to Run the command or script through any user in linux? [closed]

I am having a C executable in AIX system by which I can run the command through any user like root or system users. script having below permissions. On AIX server lrwsrwxrwx 1 root system 24 ...
1
vote
1answer
263 views

Alternatives to suid, for script and interpreted languages

On Unixes (including Gnu/Linux) suid/sgid (or file capabilities) is the only, native (all other ways use this way), way to escalate privileges. As a sysadmin, I like to write scripts as they are ...