LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-20-2004, 05:37 AM   #1
taqs
LQ Newbie
 
Registered: Aug 2004
Location: Lahore,Pakistan
Posts: 5

Rep: Reputation: 0
Creating a linux user through php


Hi All,
i want to create linux user, set his password and create a mailbox for the created user. I am trying exec method to execute the useradd command but no luck.
Any help is highly appreciated.
 
Old 08-20-2004, 05:47 AM   #2
demoncheese
LQ Newbie
 
Registered: Aug 2003
Location: South East England
Distribution: Suse 9.1, Mandrake 9.2 & 10, Fedora Core 2 & IPCop 1.3
Posts: 11

Rep: Reputation: 0
You should be able to use exec or the backtick to execute commands to do that but you will need to make sure that safe_mode is off to let you do that - by default it will be on.
 
Old 08-23-2004, 06:05 AM   #3
taqs
LQ Newbie
 
Registered: Aug 2004
Location: Lahore,Pakistan
Posts: 5

Original Poster
Rep: Reputation: 0
Need things to be more explained

I 've been trying to find a solutions for this problem. Some articles suggest that i will have to run apache process as a root user to execute exec command. Or as you said i will have to turn the safe mode off.
But i have not been able to find how to perform these tasks.
Can you please tell me some link where this process is explained ?
 
Old 08-23-2004, 12:42 PM   #4
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
just change the User and Group directives in httpd.conf to root value for both, but after that you shouldn't run this server over the internet.
 
Old 08-24-2004, 05:55 AM   #5
taqs
LQ Newbie
 
Registered: Aug 2004
Location: Lahore,Pakistan
Posts: 5

Original Poster
Rep: Reputation: 0
HTTPD Fails if i set root value for user and group attributes

Hi,
If i change user and group attribute values to root. HTTPD service fails.
i really am stuck with it.
Please help.
 
Old 08-24-2004, 06:30 AM   #6
demoncheese
LQ Newbie
 
Registered: Aug 2003
Location: South East England
Distribution: Suse 9.1, Mandrake 9.2 & 10, Fedora Core 2 & IPCop 1.3
Posts: 11

Rep: Reputation: 0
You shouldn't need to run Apache as root to do this as my webmin install can do it fine and Apache is not running as root on my machine.

The best way round it is probably to download and have a look at the way webmin (www.webmin.com) implements adding a new user. You should be able to su and then add the user using either the exec command in php iteself or using it to run a bash script to create the user.

To run exec though you should will need to make sure that PHP is not running in safe mode, You should be able to turn it off by editing the line in the php.ini file from 'safe_mode = On' to 'safe_mode = Off' and restarting the server.

As Cedrik said though, I wouldn't allow the server access from the internet.
 
Old 08-24-2004, 12:29 PM   #7
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
from the webmin site :

Webmin consists of a simple web server, and a number of CGI programs which directly update system files like /etc/inetd.conf and /etc/passwd. The web server and all CGI programs are written in Perl version 5, and use no non-standard Perl modules.

Webmin is not an apache web server, it is a standalone web server and it is run as root to be able to change settings like DNS config, Lilo/Grub config etc...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
useradd:'invalid user name' error when creating a machine account on RedHat Linux ES4 santosh0805 Linux - General 1 07-12-2005 08:39 AM
what is the command to make a user change their password after creating a new user? naweenio Linux - Newbie 7 01-05-2005 07:07 AM
Creating user in linux with the same or less privilage as root Tereno Linux - General 3 12-02-2004 06:36 AM
Creating user in linux with the same or less privilage as root sillyman Linux - General 2 12-01-2004 03:41 PM
Creating form with PHP absolut Linux - Newbie 1 01-21-2004 01:11 AM


All times are GMT -5. The time now is 04:43 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration