I created a small script as the root user...
#!/bin/bash
cat /etc/shadow
and set the setuid bit and placed it within the guest folder. When I ran the script as guest, it showed permission denied. Why? I had the root setuid bit set on it which should execute it with the root privileges as root user created the script.
/bin/sh
being a currentdash
? – Philippos Sep 24 '19 at 15:15-p
option tosh
, it does work with/bin/sh
being either a currentdash
orbash
(as that from debian buster). The-p
option will cause an error with older versions ofdash
(or with busybox), I've added a note about that. (btw, I don't get notifications about comments without the at-user) – Sep 25 '19 at 15:31