Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Perl Script, to create new unix users
euromail
post May 21 2004, 03:07 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 21-May 04
Member No.: 3,001



My first post here, so hello everyone smile.gif

I'm working on a webmail system and would like to know how to create unix users from a registration page, I'm assuming I'll need to use perl?

Anybody got ANY ideas? I've tried a quick trawl of google and hotscripts.com to no avail

Any help would be really appreciated wink.gif
Go to the top of the page
 
+Quote Post
Hemant
post May 22 2004, 08:48 AM
Post #2


RMS is my Hero
******

Group: Support Specialist
Posts: 782
Joined: 6-October 02
From: Trichy,INDIA
Member No.: 29



i can do that in PHP any takers...?????? biggrin.gif biggrin.gif biggrin.gif


--------------------
Hemant Kumar
user posted image
hemant@linuxhelp.net
Go to the top of the page
 
+Quote Post
Hemant
post May 24 2004, 07:44 AM
Post #3


RMS is my Hero
******

Group: Support Specialist
Posts: 782
Joined: 6-October 02
From: Trichy,INDIA
Member No.: 29



Well...it seems that there are no takers for PHP script. mad.gif mad.gif

So...i will tell you how you can do it in perl...I am not a perl master..But i thing adding users via registration page should be simple(..could be dangerous also from security point of view).

All you have to do is to execute the command useradd and pass the arguments provided by the user.there must be some way in perl which allows..you to execute command...Likesystem function of C.

Just use that function and pass the arguments to the function and execute useradd and it will work.If you don't know that..and you are a complete noob in perl then i will check out and reply soon.


--------------------
Hemant Kumar
user posted image
hemant@linuxhelp.net
Go to the top of the page
 
+Quote Post
Termina
post May 24 2004, 12:31 PM
Post #4


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



I too made a PHP script for that. wink.gif Well, a PHP script that uses a bash script. XD It asks for a username, password, and description. It then makes sure that the user owns their own folder, and that nobody is the group owner (so that people can view your public_html dir, if you have one).

There's probally an easier way to do this, but I'm far too lazy to figure out another way. happy.gif

#!/bin/bash
sudo useradd $1 -m -p $2 -s /bin/bash
echo "$3" > /home/$1/.plan
sudo /bin/chown -R $1 /home/$1
sudo /bin/chgrp -R nobody /home/$1


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 15th December 2017 - 11:09 AM