The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
To What files root does not have access to?? mgirinath Shell Programming and Scripting 3 12-07-2005 09:14 PM
log root access dsbeck UNIX for Dummies Questions & Answers 1 08-30-2005 11:27 PM
root access RBurer SCO 2 05-18-2005 02:36 PM
how to access root priveliges if root password is lost wojtyla Linux 1 02-18-2005 06:24 AM
root access on sun os and permissions allinone UNIX for Dummies Questions & Answers 2 03-12-2002 10:34 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-01-2005
Sergiu-IT's Avatar
Sergiu-IT Sergiu-IT is offline
Registered User
  
 

Join Date: Mar 2005
Location: Transilvania
Posts: 133
PHP - few things without root access

Helo, everybody !
I want to set up a web server. To make my work a little bit easyer, I surfed the internet to see how other web sites/servers are configured, and a few questions joined my mind (as I've never done a web server). So, my main question is:
- How can I add some users from a web page, without setting apache to run as root ?.

I guess that you agree with me when I say that it's realy stupid to run a web server as root. Anyway, what I realy want is not only that... I want the script that I'll create to add a user, and to create a public_html directory in the user's home directory, and also copy into that directory a PHP script (phpMyAdmin). Also, after I'm doing this, I want to set in the /etc/ftpchroot file the user name...

So, shortly, this is what I want to do. How can I do it, without configuring apache to use root as the default user, and without changing the file atributes (for ftpchroot and other files that I wouldn't like to modify) ? Any sugestions ? Any FM to read ? Or some tutorials... or just a few words to get the ideea...
I'll appreciate any kind of help.
Thanks !
  #2 (permalink)  
Old 04-01-2005
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
i, myself, would never create an automatic user creation script from a webpage but since you asked for ideas ...

you can have the users fill a form that corresponds to the /etc/passwd fields and then have a background job --- running as root --- look at the form, create the accounts, and zero out the form again ...

*** make sure your script sets the uid and gid as well as do sanity checks on the information so you don't automatically give somebody full access to your server without knowing who they are ...
  #3 (permalink)  
Old 04-01-2005
Sergiu-IT's Avatar
Sergiu-IT Sergiu-IT is offline
Registered User
  
 

Join Date: Mar 2005
Location: Transilvania
Posts: 133
Hi !
Well... it sounds simple enough... Thanks for the ideea.
Bye !
  #4 (permalink)  
Old 04-05-2005
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,819
If, on Linux, you can try the newusers utility:


Code:

NAME
       newusers - update and create new users in batch

SYNOPSIS
       newusers [new_users]

DESCRIPTION
       newusers  reads  a file of user name and cleartext password pairs and uses
       this information to update a group of existing  users  or  to  create  new
       users.  Each line is in the same format as the standard password file (see
       passwd(5)) with the following exceptions.

       pw_passwd This field will be encrypted and used as the new  value  of  the
                 encrypted password.

       pw_age    This  field  will  be  ignored  for shadow passwords if the user
                 already exists.

       pw_gid    This field may be the name of an existing group, in  which  case
                 the  named  user  will  be added as a member.  If a non-existent
                 numerical group is given, a new group  will  be  created  having
                 this number.

       pw_dir    This  field  will  be checked for existence as a directory and a
                 new directory with the same name will be created if it does  not
                 already exist.  The ownership of the directory will be set to be
                 that of the user being created or updated.

(more)

There are many important web applications where accounts need to be created on a server, certainly if you are selling inexpensive web hosting with shell access, mail accounts, etc.
  #5 (permalink)  
Old 04-06-2005
Sergiu-IT's Avatar
Sergiu-IT Sergiu-IT is offline
Registered User
  
 

Join Date: Mar 2005
Location: Transilvania
Posts: 133
Hi !
Well... if I'll not find another solution in the next few days... I'll use Linux on my server.
Thanks for your hint !
Bye !
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0