• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 458
  • Last Modified:

Adding users

I am trying to create a web interface that will enable me to create new users on a Linux system.  What I was thinking of doing was sending a file over to the Linux system by FTP which contains the relevant details of the new user.  I would then use Cron to check every n minutes if this file exists.  If it does a script would be run which would create the new user.  Does this sound possible.  In particular I would like details of the shell script necessary to create the new user, taking the details from the indicator file sent over by FTP.
0
bsufs
Asked:
bsufs
  • 4
  • 3
1 Solution
 
marcelofrCommented:
I think it would be risky to execute as root something on information that comes from outside ...

If you want to create a web interface, think it as a security risk you need to secure, try to get inspiration from any of the working programs that do this (as http://www.solucorp.qc.ca/linuxconf/)
0
 
nobbsCommented:
In case of running a Web-Server on this Linux-System you can imply create a cgi to get the User-Information from the Web-Page. The cgi could insert the User-Data in the /etc/passwd File.


0
 
bsufsAuthor Commented:
The web server is not running on the Linux system that I want to add users to.  I could write a script that will insert information into the /etc/passwd file but what would you do about the password which needs to be encrypted.  Would it then be possible to write a script that changes the password?

Thanks for your help.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
nobbsCommented:
You can use the useradd command from a script, so the user will be inserted with password.
0
 
bsufsAuthor Commented:
useradd doesn't work on my system but adduser does.  How would you run this from a script? - it prompts the user step-by-step for inputs.  What I want to do is add the user all in one go, taking the information from the script.  Could you give me a hint as to how I would do this.

Thanks for your help.
0
 
nobbsCommented:
I don't know adduser, but on a normal Linux-System, you shold have the useradd command.
0
 
bsufsAuthor Commented:
I don't have useradd but I think adduser is the same.  What I'd like to know is, is it possible to call such a command which requires inputs from a script?

Thanks
0
 
nobbsCommented:
You will find a complete script at:
http://www.metronet.com/1/perlinfo/scripts/admin/adduser
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now