A tricks on how to run a script as root without sudo, in case someone needs this. I use this for toggle on and off camera without pkexec. It’s useful imho
- randompepsi ( @randompepsi@lemmy.ml ) 24•1 year ago
Bad idea
- Papamousse ( @Frederic@beehaw.org ) 13•1 year ago
Oh, in the 90s I worked at a big defense contractor, one of a shell script had a suid on it, so just by creating a symbolic link named “-x” pointing to the script, and executing it, you entered in a root shell ☺️
- perviouslyiner ( @perviouslyiner@lemm.ee ) English10•1 year ago
Avoid using sudo and setuid by writing your own sudo program using setuid?
- nyan ( @nyan@lemmy.cafe ) English8•1 year ago
How to run a shell script with root permisions without sudo? su to root. Or set up the correct permissions for the script and whatever it needs to touch, and add your user to any required groups, so that you don’t need to be root to run the script. Rolling your own solution is never a good idea for anything security-related.
- rotopenguin ( @rotopenguin@infosec.pub ) English2•1 year ago
Do you know how many times I’ve made some little bit of shell code “setuid” by writing a shitty little C program that just calls system()?