Run command with specific arguments without password as root for all users [duplicate]
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
This question already has an answer here:
How do I use command arguments with Cmnd_Alias in sudoers?
2 answers
I want to be able to run fdisk -l
as any user, without getting the whole fdisk: cannot open /dev/sda: Permission denied
message.
I don't see how fdisk -l
can be used for malicious purposes.
I have a PHP script, which first checks if the user is logged into my website, and if they are admin.
Then I have an admin control panel, where it shows the output of fdisk -l
, however, I am getting the error fdisk: cannot open /dev/sda: Permission denied
.
There is no user input, so they can't inject arguments into the command.
permissions su fdisk
marked as duplicate by Jeff Schaller, Romeo Ninov, Christopher, roaima, Timothy Martin Mar 24 at 0:22
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
0
down vote
favorite
This question already has an answer here:
How do I use command arguments with Cmnd_Alias in sudoers?
2 answers
I want to be able to run fdisk -l
as any user, without getting the whole fdisk: cannot open /dev/sda: Permission denied
message.
I don't see how fdisk -l
can be used for malicious purposes.
I have a PHP script, which first checks if the user is logged into my website, and if they are admin.
Then I have an admin control panel, where it shows the output of fdisk -l
, however, I am getting the error fdisk: cannot open /dev/sda: Permission denied
.
There is no user input, so they can't inject arguments into the command.
permissions su fdisk
marked as duplicate by Jeff Schaller, Romeo Ninov, Christopher, roaima, Timothy Martin Mar 24 at 0:22
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
How do I use command arguments with Cmnd_Alias in sudoers?
2 answers
I want to be able to run fdisk -l
as any user, without getting the whole fdisk: cannot open /dev/sda: Permission denied
message.
I don't see how fdisk -l
can be used for malicious purposes.
I have a PHP script, which first checks if the user is logged into my website, and if they are admin.
Then I have an admin control panel, where it shows the output of fdisk -l
, however, I am getting the error fdisk: cannot open /dev/sda: Permission denied
.
There is no user input, so they can't inject arguments into the command.
permissions su fdisk
This question already has an answer here:
How do I use command arguments with Cmnd_Alias in sudoers?
2 answers
I want to be able to run fdisk -l
as any user, without getting the whole fdisk: cannot open /dev/sda: Permission denied
message.
I don't see how fdisk -l
can be used for malicious purposes.
I have a PHP script, which first checks if the user is logged into my website, and if they are admin.
Then I have an admin control panel, where it shows the output of fdisk -l
, however, I am getting the error fdisk: cannot open /dev/sda: Permission denied
.
There is no user input, so they can't inject arguments into the command.
This question already has an answer here:
How do I use command arguments with Cmnd_Alias in sudoers?
2 answers
permissions su fdisk
asked Mar 23 at 9:33
Jacob Collins
1
1
marked as duplicate by Jeff Schaller, Romeo Ninov, Christopher, roaima, Timothy Martin Mar 24 at 0:22
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Jeff Schaller, Romeo Ninov, Christopher, roaima, Timothy Martin Mar 24 at 0:22
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
A solution would be to create a program calling fdisk
. Writing it in CC++ would be easy, you just need a compiler. Then change the owner of the executable to root
and give it the SUID
right (giving the SUID
to a script won't work that's why you'll need an executable not a script). Make sure no other user can write to that file or it could cause a security issue.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
A solution would be to create a program calling fdisk
. Writing it in CC++ would be easy, you just need a compiler. Then change the owner of the executable to root
and give it the SUID
right (giving the SUID
to a script won't work that's why you'll need an executable not a script). Make sure no other user can write to that file or it could cause a security issue.
add a comment |Â
up vote
0
down vote
A solution would be to create a program calling fdisk
. Writing it in CC++ would be easy, you just need a compiler. Then change the owner of the executable to root
and give it the SUID
right (giving the SUID
to a script won't work that's why you'll need an executable not a script). Make sure no other user can write to that file or it could cause a security issue.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
A solution would be to create a program calling fdisk
. Writing it in CC++ would be easy, you just need a compiler. Then change the owner of the executable to root
and give it the SUID
right (giving the SUID
to a script won't work that's why you'll need an executable not a script). Make sure no other user can write to that file or it could cause a security issue.
A solution would be to create a program calling fdisk
. Writing it in CC++ would be easy, you just need a compiler. Then change the owner of the executable to root
and give it the SUID
right (giving the SUID
to a script won't work that's why you'll need an executable not a script). Make sure no other user can write to that file or it could cause a security issue.
answered Mar 23 at 13:39
dev93
115
115
add a comment |Â
add a comment |Â