PHP - few things without root access


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting PHP - few things without root access
# 1  
Old 04-01-2005
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 Smilie ? Or some tutorials... or just a few words to get the ideea...
I'll appreciate any kind of help.
Thanks !
# 2  
Old 04-01-2005
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  
Old 04-01-2005
Hi !
Well... it sounds simple enough... Thanks for the ideea.
Bye !
# 4  
Old 04-05-2005
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  
Old 04-06-2005
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 !
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Open Source

Vendor root access

All, I wanted to get others opinions on providing root access to vendors. I have a vendor that is claiming to need full root sudo access to complete a one time system set up for their software. The system is on our corporate network and we never provide this level of access. Not only that,... (7 Replies)
Discussion started by: hburnswell
7 Replies

2. Ubuntu

Root access that can't change root password?

We are having a little problem on a server. We want that some users should be able to do e.g. sudo and become root, but with the restriction that the user can't change root password. That is, a guarantee that we still can login to that server and become root no matter of what the other users will... (2 Replies)
Discussion started by: 244an
2 Replies

3. SuSE

Auditors want more security with root to root access via ssh keys

I access over 100 SUSE SLES servers as root from my admin server, via ssh sessions using ssh keys, so I don't have to enter a password. My SUSE Admin server is setup in the following manner: 1) Remote root access is turned off in the sshd_config file. 2) I am the only user of this admin... (6 Replies)
Discussion started by: dvbell
6 Replies

4. Shell Programming and Scripting

How to give root access to non root user?

Currently in my system Red Hat is installed. And Many user connect to my machine via SSH Techia Terminal. I want to give some users a root level access. Can anyone please help me how to make it possible. I too searched on the Google but didn't find the correct way Regards ADI (4 Replies)
Discussion started by: adisky123
4 Replies

5. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

6. UNIX for Dummies Questions & Answers

things root can't do

Hey all my co-workers and I are trying to put together a list of things root "Can't" do on any *NIX OS, so I wanted to come here and see what all we could come up with. Here are two to start this off: write to a read only mount FS kill a tape rewind Please add what you know. Thanks,... (5 Replies)
Discussion started by: sunadmn
5 Replies

7. AIX

root access

Hello I have a question. I have a box with Aix 5.3 but I want to disable root access direct from any terminal or console. I mean If I want to login to 10.10.10.10 login:root password ********* Root access is not permited Which file I have to edit. to the users first login with... (4 Replies)
Discussion started by: lo-lp-kl
4 Replies

8. Solaris

Security of root access

Hi, The security auditor give a this statement , what to do ? On my solaris system (S10) "The User ID "root" should not be used on the system - the su and the priviledged account should be used from each administrator for accountability purposes" What to do ? (3 Replies)
Discussion started by: falcon16
3 Replies

9. SCO

root access

We have SCO 5.0.5 and can't log into system as "root". The system indicates the password is incorrect. No one knows what happened. How can we resolve this issue.. Are there files we can restore from backup...? Any suggestions would be appreciated. Thank you.. (2 Replies)
Discussion started by: RBurer
2 Replies

10. Linux

how to access root priveliges if root password is lost

wish to know how to access root password it root password is forgotten in linux (1 Reply)
Discussion started by: wojtyla
1 Replies
Login or Register to Ask a Question