For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > September 2004 > running a program









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author running a program
Octavian Rasnita

2004-09-27, 8:55 am

Hello,

I want to make a cgi program that can be accessed from the web and which
can run a certain program using another user than the web server's user.

Please help me for two things:

1. Tell me how to run any simple program using my own user.

2. Tell me how to run a certain program using root's priviledges if my user
can use them using the "sudo su" command.

For example I want to create a program that can launch the following
command:

service sshd start

Thank you.

Teddy

Bill Jones

2004-09-27, 3:55 pm


--- Octavian Rasnita <orasnita@fcc.ro> wrote:

> Hello,
>
> I want to make a cgi program that can be accessed from the web and
> which
> can run a certain program using another user than the web server's
> user.
>
> Please help me for two things:
>
> 1. Tell me how to run any simple program using my own user.
>
> 2. Tell me how to run a certain program using root's priviledges if
> my user
> can use them using the "sudo su" command.
>
> For example I want to create a program that can launch the following
> command:
>
> service sshd start



You first need to get "promoted to" the appropriate userid.

There is an example of how to do this in my CPAN directory (listed
under sneex) - but I used expect (expect.nist.gov) not Perl per se.

What yo are sing to do isn't secure - so I would protect the cgi via
ssl with basic authentication.

HTH/Sx


=====
-Sx-
sing employment: http://youve-reached-the.endoftheinternet.org/



__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com