Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi All!
This would be more of a Unix question rather than Perl, but im sure the Monks will be able to help :o)
I have a webpage that needs to mount and unmount a drive. The drive is being mounted as username "www-data". I can only unmount with sudo: "sudo umount *drive*". I do have sudo umount privileges on a username other than "www-data". I do not know the password for "www-data", nor am i sure that it would actually have the privileges to unmount as itself.
Being on a web page, is there a way for me to say: i want to unmount this drive as if i was trying to sudo as "other_username" and not "www-data"? "sudo -u other_username umount *drive*" doesnt work, because it tries to unmount as other_username - it needs to unmount as "root" but providing "other_username"'s credentials.
As a side note, if i get into the box as "other_username" i am able to "sudo umount" the drives that were mounted as "www-data" with no issues.
Please let me know if you see any kind of workarounds for me to be able to unmount from a webpage, or if it's mandatory to find out the password for "www-data".
This would be more of a Unix question rather than Perl, but im sure the Monks will be able to help :o)
I have a webpage that needs to mount and unmount a drive. The drive is being mounted as username "www-data". I can only unmount with sudo: "sudo umount *drive*". I do have sudo umount privileges on a username other than "www-data". I do not know the password for "www-data", nor am i sure that it would actually have the privileges to unmount as itself.
Being on a web page, is there a way for me to say: i want to unmount this drive as if i was trying to sudo as "other_username" and not "www-data"? "sudo -u other_username umount *drive*" doesnt work, because it tries to unmount as other_username - it needs to unmount as "root" but providing "other_username"'s credentials.
As a side note, if i get into the box as "other_username" i am able to "sudo umount" the drives that were mounted as "www-data" with no issues.
Please let me know if you see any kind of workarounds for me to be able to unmount from a webpage, or if it's mandatory to find out the password for "www-data".
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: sudo from Apache
by choroba (Cardinal) on Sep 02, 2011 at 08:44 UTC | |
by afoken (Chancellor) on Sep 03, 2011 at 07:34 UTC | |
Re: sudo from Apache
by pvaldes (Chaplain) on Sep 01, 2011 at 21:27 UTC | |
Re: sudo from Apache
by pvaldes (Chaplain) on Sep 01, 2011 at 22:01 UTC | |
Re: sudo from Apache
by Mushka (Acolyte) on Sep 16, 2011 at 15:37 UTC | |
Re: sudo from Apache
by Mushka (Acolyte) on Sep 19, 2011 at 13:46 UTC | |
Re: sudo from Apache
by pemungkah (Priest) on Sep 02, 2011 at 20:20 UTC |
Back to
Seekers of Perl Wisdom