Skip to main content
16 events
when toggle format what by license comment
Nov 18, 2020 at 2:43 comment added Reda Salih i think you did not get my answer, when saying that suid are not available it's not with chmod command but during the execution of your program.
Nov 18, 2020 at 2:42 comment added Reda Salih me too i didnt used them in script and it will be the same result : script or not.
Nov 18, 2020 at 2:24 comment added kevin Right, but I'm not using a script, I'm just typing them as separate commands
Nov 18, 2020 at 2:16 history edited Reda Salih CC BY-SA 4.0
added 25 characters in body
Nov 18, 2020 at 2:14 comment added Reda Salih Yes as i have told you : when executing a script with siud it gets ignored by the kernel because this feature is dismissed for executables on almost all distributions due to security matter. And note that you can also customize your kernel to accept it. Hope it's clear
Nov 18, 2020 at 2:07 comment added kevin Right, sorry if I was vague in my terminology. sudo chown root <program> - sets file ownership to root sudo chmod u+s <program> - whoever runs this program runs with root privilege Since this is not being called from a shell script, I'm not sure why its not working
Nov 18, 2020 at 1:56 comment added Reda Salih chmod and chown commands are not meant for setting privileges but instead setting permissions and ownerships ; chown ( who can access what ) ; chmod ( who can read,execute,write to )
Nov 18, 2020 at 1:52 comment added kevin Thank you Reda. But why is it that when I run chmod and chown as standalone bash commands, the program doesn't get root privilege? If I just have a compiled program, prog1 and I do chown, chmod on it, it should be enough right?
Nov 18, 2020 at 1:38 comment added Reda Salih Hi, chmod and chown are executed once and out of the script. Yes just follow the procedure to write the helper you don't have to change anything on your shell script. If this helped you you can make it as resolved ! Thanks
Nov 18, 2020 at 1:36 history edited Reda Salih CC BY-SA 4.0
added 63 characters in body
Nov 18, 2020 at 1:00 comment added kevin Also, for what you are describing, are you assuming that the chmod/chown commands are done through a script? And for those scripts to actually take place I have to create a helper C program that runs the script?
Nov 18, 2020 at 0:59 history edited Reda Salih CC BY-SA 4.0
added 38 characters in body
Nov 18, 2020 at 0:58 comment added kevin Hi Reda, Thank you for your explanation. However, I run into this case when I'm not running the chmod/chown commands through a script. Just as bash commands and the program still does not run with root privilege
Nov 18, 2020 at 0:43 history edited Reda Salih CC BY-SA 4.0
added 1 character in body; added 2 characters in body; added 31 characters in body
Nov 18, 2020 at 0:36 history edited Reda Salih CC BY-SA 4.0
added 221 characters in body; added 17 characters in body; added 16 characters in body; added 4 characters in body
Nov 18, 2020 at 0:29 history answered Reda Salih CC BY-SA 4.0