The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
4answers
59 views

File permission with setuid and octal 4000

When we set setuid to a file, we do the following in the terminal: chmod u+s filename This works fine. But the octal number 4000 is always associated with setuid (in books etc). I understand (to ...
1
vote
1answer
17 views

Apache suexec won't work with strace

I have an Apache instance with mod_suexec enabled. I'm trying to debug a problem and am starting Apache with strace to try and see what's happening. However, when I start Apache like this: # strace ...
2
votes
1answer
27 views

Why isn't 'nethogs' installed with the setuid bit set?

I've been using nethogs for a while now, having to sudo every time, while ping has the setuid bit set. Today I set it for nethogs and it works: $ ls -l $(which nethogs) $(which ping) -rwxr-xr-x 1 ...
1
vote
0answers
60 views

Limit program execution to a list of arguments

I would like that my Unix users can only run a specific command insecurecommand with a controlled list of arguments stored in a file. The only solution I have found at this time is to : Create a ...
2
votes
3answers
157 views

How do I drop root privileges in shell scripts?

The "--up" option in OpenVPN is normally used for routing etc. And so it is processed before OpenVPN drops root privileges to run as nobody. However, I am invoking shell scripts that need to run as an ...
1
vote
1answer
44 views

Why doesn't setuid not work? [duplicate]

I want my program can only be run by user xyz using root privilege. So I set setuid with: chmod u+s program1.sh ls -l program1.sh rwsr-x--- 1 root house 1299 May 15 23:54 program1.sh And I let user ...
2
votes
1answer
36 views

Using setuid Properly

I've been scared too much by the warning about setuid. However I cannot find a way around using it. I want to be able to run: arp -s 198.51.100.1 00:53:00:12:34:56 as the user steven but arp -s ...
5
votes
2answers
258 views

Group memberships and setuid/setgid processes

Processes which de-escalate privileges via setuid() and setgid() do not seem to inherit the group memberships of the uid/gid they set. I have a server process that must be executed as root in order ...
3
votes
1answer
169 views

How to let a user execute a script owned by root? Setuid doesn't seem to work anymore [duplicate]

I have some bash scripts that I use with the user 'root' to manage iptable rules. The problem is that I want these things at the same time: The script must be owned by root Permissions must be 700 ...
3
votes
2answers
87 views

using SUID bit to drop privileges

So this is a description of the system I'm working on : a "manager" process spawns all the other applications. The manager application runs as root user. so now, any process that it spawns also ...
0
votes
1answer
58 views

Principle of least privilege: Does Authbind helper really need setuid root, or can it run with cap_net_bind_services?

Does Authbind's helper really need setuid root, or can it run with the CAP_NET_BIND_SERVICES capability and still work?
3
votes
2answers
86 views

set umask (permissions) similarly as setgid on a directory

I know how to use setgid on directories, to enforce that whole directory structure has uniform user:group ownership. Is there a similar way to set the umask for a directory, so that the whole ...
1
vote
1answer
69 views

Why doesn't setuid on /sbin/dhclient work as intended?

I am the only user on my machine, and prefer not to type sudo every time I use dhclient. Therefore, I tried sudo chmod u+s /sbin/dhclient. However, when I subsequently run dhclient wlan0 from a ...
6
votes
3answers
196 views

Under what scenarios would I want to set a SUID bit?

I'm struggling to wrap my mind around the concept of SUID bits and why they're would be useful. For example, let's say I have a program: -rwsr-xr-x 1 root root 12364 Jan 12 2013 ...
0
votes
0answers
84 views

Running MATLAB on Linux with SGID

I want to run my matlab instance as a special group. I tried setting sgid on matlab-startup-script or (not exclusive) on MATLAB-binary. Both ways were not successful. For example running sudo chmod ...
2
votes
0answers
47 views

LXC: Have rootfs mounted without nosuid

I have the container's rootfs in a volume mounted with the nosuid option. When I start the container, its / mounted is then also mounted nosuid, which breaks programs such as sudo. How can I avoid ...
5
votes
2answers
1k views

Setuid bit seems to have no effect on bash

I was experimenting with the security of my system and noticed something strange: setting the setuid bit on a copy of bash located at /usr/bin/bash-test seemed to have no effect. When I ran an ...
3
votes
1answer
73 views

how to record command which execute a programme suid

My question: Is there a way to record all commands who execute a suid programme? Like what .bash_history do, but only the setuid programmes.
3
votes
1answer
191 views

How does having /dev/fd make running shell scripts under sudo safe?

At the end of the man page for sudo, there's the following remark: Running shell scripts via sudo can expose the same kernel bugs that make setuid shell scripts unsafe on some operating systems ...
24
votes
1answer
567 views

What would be the best way to work around this glibc problem?

I administer a Gentoo Hardened box that uses file capabilities to eliminate most of the need for setuid-root binaries (e.g. /bin/ping has CAP_NET_RAW, etc). Infact, the only binary I have left is ...
1
vote
1answer
773 views

How to suid iwconfig on Debian wheezy?

I have a script running under my own user account that takes care of all sorts of wireless interfaces. It (more or less) intelligently switches wireless LAN off and on and so forth. However, it does ...
2
votes
1answer
212 views

How to set up a script to run as root non-interactively?

I need to set up the following script to run as root whenever I log in: #!/bin/zsh truncate -s 0 ~yourstruly/.juniper_networks/network_connect/ncsvc.log I know how to run the script as root ...
1
vote
2answers
426 views

setuid programs don't seem to run setuid in TinyCore Linux

I want to demonstrate the vulnerability of setuid programs using the TinyCore Linux live cd. That is, I craft a special program, with special permissions, so that it runs as the owner of the file ...
4
votes
2answers
387 views

Purpose of using setuid() in SUID programs

I wonder that an SUID program like passwd is using the setuid() function call. Why does it drop root privileges? Against what types of attack does this help? Buffer-overflow?
4
votes
1answer
426 views

Clear setuid permission using numeric mode

On an Ubuntu Linux I have a directory with the setuid bit set (drwsr-xr-x) which I want to unset. Neither chmod 755 nor chmod 0755 nor chmod 00755 (I though maybe the first 0 is interpreted as just ...
2
votes
3answers
2k views

How does the set-user-ID mechanism work in Unix?

Can someone please explain the set-user-ID mechanism in Unix ? What was the rationale behind this design decision? How is it different from effective user id mechanism ?
3
votes
1answer
506 views

How to replace setuid with file-system capabilities

Inspired by this question here is the follow-up: As some of you may know setuid-binaries are dangerous, since some exploits use these to escalate their rights up to root. Now it seems that there has ...
2
votes
2answers
555 views

setuid and setgid confusion

I'm trying to fully grasp the concept of setuid and setgid, and I'm not quite sure in what way permissions are actually elevated. Let me provide an example: Users userA (groups: userA groupA) userB ...
5
votes
1answer
309 views

root owned program with setuid bit on

Ping is a a program owned by root with the user id bit set. $ ls -l `which ping` -rwsr-xr-x 1 root root 35752 Nov 4 2011 /bin/ping As I understand it, if a user runs the ping process, then the ...
3
votes
1answer
372 views

Environment settings on setuid executables

I am observing a curious behavior when running a program with setuid bit enabled. Program foo is owned by user bar with setuid bit set. User execbar runs foo foo reports that one of the dynamic ...
3
votes
1answer
152 views

Running setuid binary temporarily without setuid?

Currently setting up xpra, which wants to run an X instance as non-root using the dummy driver, but the system Xorg binary is SUID. Since the system auto-updates, I would prefer not making and ...
3
votes
3answers
5k views

What does GID mean?

What does GID actually mean? I have Googled it and this is what linux.about.com said: Group identification number for the process. Valid group numbers are given in /etc/group, and in the GID field ...
4
votes
2answers
1k views

Why is mount.cifs not installed suid by default?

I am using Gentoo, and on my machine at least mount.cifs is not installed suid root by default. In particular, this means that I can't use the user mount option with CIFS shares. I noticed that ...
2
votes
1answer
565 views

using Set uid to run a root command from non-root user

Consider the following two files. summarize's executable UID bit has been set, so that another user belonging to another group can execute the summarize executable that uses the customers.dat file. ...
-1
votes
1answer
236 views

Are there any setuid/setguid bits in OpenBSD?

https://en.wikipedia.org/wiki/Setuid Are there anything like this under OpenBSD?
5
votes
3answers
2k views

Changing the UID of files in /proc

In a follow up to this question about changing the UID of a user, it is recommended to change the ownership of all files on the system (this answer) find / -uid 1000 -exec chown 5000 '{}' \+ where ...
2
votes
3answers
359 views

How does setting the Setuid bit affect shell scripts that run on boot of the system, before any login has occurred?

Would enabling the setuid bit on a shell script make a difference at all when that script is run on boot? Who would the effective user be?
5
votes
4answers
3k views

how does real and effective user ID works?

When a normal user wants to make change to the passwd file, the user will by setuid be given the effective user access. User becomes root temporarily and can edit passwd. However you can only edit ...
4
votes
2answers
2k views

Can gdb debug suid root programs?

I wrote a program that calls setuid(0) and execve("/bin/bash",NULL,NULL). Then I did chown root:root a.out && chmod +s a.out When I execute ./a.out I get a root shell. However when I do gdb ...
2
votes
2answers
393 views

Unix executable file permission vs runtime user's permissions

I have heard that it is good practice to run an executable as a user with a completely different privilege set than the owner of the task. In fact I heard that it is best to run it as a different user ...
56
votes
5answers
31k views

Allow setuid on shell scripts

The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor: > cat setuid-test.c #include <stdio.h> #include <unistd.h> int ...