?
Solved

Adding users

Posted on 1998-09-15
8
Medium Priority
?
451 Views
Last Modified: 2010-04-20
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
Comment
Question by:bsufs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 3

Expert Comment

by:marcelofr
ID: 1638032
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
 

Expert Comment

by:nobbs
ID: 1638033
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
 

Author Comment

by:bsufs
ID: 1638034
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
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 

Accepted Solution

by:
nobbs earned 200 total points
ID: 1638035
You can use the useradd command from a script, so the user will be inserted with password.
0
 

Author Comment

by:bsufs
ID: 1638036
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
 

Expert Comment

by:nobbs
ID: 1638037
I don't know adduser, but on a normal Linux-System, you shold have the useradd command.
0
 

Author Comment

by:bsufs
ID: 1638038
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
 

Expert Comment

by:nobbs
ID: 1638039
You will find a complete script at:
http://www.metronet.com/1/perlinfo/scripts/admin/adduser
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question