Sample Header Ad - 728x90

Run a script as root with SUID

0 votes
0 answers
59 views
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 group # chmod u+xs,g+x update.sh and this is what I have: -rwsrwxr-- 1 root me 35 Mar 21 09:48 update.sh* So I was expecting that by running this script which I have permission to run (it belongs to my group), it gets the root UID and it will execute as root, but I get permission denied.
Asked by Sasan (143 rep)
Mar 21, 2020, 10:34 AM
Last activity: Mar 21, 2020, 11:39 AM