Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I've poked around and read several articles, but haven't found an answer to this. If someone already knows of an article that explains what I need to do, just point me there.

I have an ISP who has requested that I write them a script to create a directory hierchy the first time a user logs in. I believe I can figure out how to actually issue all the commands, but he has pointed out that these commands all need to be executed as root.

So, with that said, how would you guys do the following:

WEB INTERFACEABLE FORM.. Enter User Name:____{USER}__________ ********* *SUBMIT* On the server side……. NEEDS TO EXICUTE AS ROOT!! Using the username as the variable value = {USER} **START** Cd /home/{USER} Mkdir www Cd www Mkdir htdocs Mkdir logs Cd .. Chown {USER}:nobody www –R Cd .. Chown {USER}:nobody {USER} **STOP**

Thanks in advance for your assistance.


In reply to How do I execute as root? by Kurious

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2021-10-17 04:45 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (71 votes). Check out past polls.