LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sudo (https://www.linuxquestions.org/questions/linux-newbie-8/sudo-556793/)

nerooo 05-26-2007 01:49 AM

sudo
 
I have a question about sudo. Currently, when I use sudo on a system, I don't have to supply a password for restarting apache. Is it possible to set a password and pipe it to sudo?

b0uncer 05-26-2007 03:35 AM

I guess it is, but to me it sounds like a security risk "piping" a password, especially if you thought to do it clear-text-wise.

EDIT: of course it's not good having no password at all, either.

nerooo 05-26-2007 03:40 AM

Quote:

Originally Posted by b0uncer
I guess it is, but to me it sounds like a security risk "piping" a password, especially if you thought to do it clear-text-wise.

EDIT: of course it's not good having no password at all, either.

I wasn't planning on doing in real clear text. But using a C application something like this:

char pass[20]={98,105,106,111};
sprintf(cmd, "echo %c%c%c%c | sudo -S /etc/init.d/apache2 restart", pass[2], pass[3], pass[0], pass[1]);
system(cmd);


All times are GMT -5. The time now is 05:11 PM.