How to switch the user before executing a shell script from web page?? | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

How to switch the user before executing a shell script from web page??

UNIX for Dummies Questions & Answers


Tags
html, perl, shell scipt

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-28-2013
Little Little is offline
Registered User
 
Join Date: Feb 2013
Last Activity: 3 January 2014, 6:46 AM EST
Posts: 177
Thanks: 32
Thanked 9 Times in 8 Posts
How to switch the user before executing a shell script from web page??

hi,

i want to execute a shell script as a different user. the flow is like this.

there is a html web page from which i have to call a shell script. web server is apache. to call the shell script from html page, a perl script is required.

so the html page calls the perl script and the perl script in turn calls the shell script. owner of the shell script is "abc" user.

so when the shell is called via the html page->perl script-> shell script, the shell script is run by "apache" user instead of "abc" user. so is it possible to switch the user to "abc" from "apache" in any of the scripts (i.e perl or shell script )just before the shell script is called.
Sponsored Links
    #2  
Old 06-28-2013
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 2 September 2014, 1:19 PM EDT
Location: Switzerland - GE
Posts: 5,651
Thanks: 152
Thanked 391 Times in 370 Posts
This may mean having access to root account for I doubt you are given apache's passwd or do you have it? or root account access?
Sponsored Links
    #3  
Old 06-28-2013
alister alister is offline
Registered User
 
Join Date: Dec 2009
Last Activity: 11 June 2014, 8:40 PM EDT
Posts: 3,231
Thanks: 179
Thanked 973 Times in 789 Posts
sudo is one alternative.

Regards,
Alister
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to switch user using shell script ? milink Shell Programming and Scripting 1 02-15-2012 05:35 AM
Switch User in within a Shell Script Afi_Linux Shell Programming and Scripting 16 10-27-2010 07:25 PM
how to redirect to a web-page by shell script ravi18s Shell Programming and Scripting 3 05-18-2009 08:30 AM
Executing shell program from a web page venkatritch Shell Programming and Scripting 5 06-14-2008 05:36 AM
running shell script thru WEB page .... Nicol Shell Programming and Scripting 6 07-21-2004 10:42 AM



All times are GMT -4. The time now is 10:07 PM.