LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-28-2006, 07:49 AM   #1
hipchatterbug
LQ Newbie
 
Registered: Nov 2006
Posts: 3

Rep: Reputation: Disabled
Using NEWUSERS command


I am using the newusers command to add multiple users to a linux machine. Only problem is when it creates the user it doesnt create a home directory or any of the folders i want it to, but it does create the accounts. Can anyone tell me what code i need so that is creates folders where i want them to, here is the code i got so far:
______________________________...
#!/bin/sh

for i in `cat /home/student/public_html/WebD...
do

newusers /home/student/public_html/WebD...

done
cp /home/student/public_html/WebD... /home/student/public_html/WebD... -f
______________________________...

I want the new users to have the same pathway:
/home/newuser/public_html/

but there username would be in the newuser part. can anyone help me please!
 
Old 11-28-2006, 08:03 AM   #2
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
Check out this link and read the part about /etc/skel directory.
 
Old 11-28-2006, 08:07 AM   #3
hipchatterbug
LQ Newbie
 
Registered: Nov 2006
Posts: 3

Original Poster
Rep: Reputation: Disabled
I already have a the publi_html folder created in the skel directory but it still wont add the directories when the users are being added to the system, they have accounts but no folders or directories

let me explain more i a have a text file containing (example):

jimBob:vyxwoczw:::jimmy@hotmail.com:home/jimBob

this is one entry that newusers will add, but i cant get the newusers to run successfully now and it wont add anyone to the system

Last edited by hipchatterbug; 11-28-2006 at 08:31 AM.
 
Old 11-28-2006, 09:08 AM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
use the useradd command, and the -m option. Read the useradd manual page first. Also, please use [code] tags when posting code excepts.
 
Old 11-30-2006, 04:02 AM   #5
hipchatterbug
LQ Newbie
 
Registered: Nov 2006
Posts: 3

Original Poster
Rep: Reputation: Disabled
I cant use ADDUSER because I have to use NEWUSERS, I am doing a project that requires me to use NEWUSERS
 
Old 11-30-2006, 04:31 AM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Quote:
Originally Posted by hipchatterbug
I cant use ADDUSER because I have to use NEWUSERS, I am doing a project that requires me to use NEWUSERS
Why the constraint?
 
Old 11-30-2006, 08:27 AM   #7
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
You might want to edit your text file.

Quote:
let me explain more i a have a text file containing (example):

Quote:
jimBob:vyxwoczw:::jimmy@hotmail.com:home/jimBob
It should be:
Code:
jimBob:vyxwoczw:::jimmy@hotmail.com:/home/jimBob
Notice the added "/" without it you would be using a relative path rather than a absolute path. Let me know if that makes a difference?

Regards,
Fordeck
 
  


Reply



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
newusers - command not found Jayla Linux - Newbie 12 10-23-2006 12:41 PM
Newusers command problem. Schlzm Linux - General 6 12-06-2005 09:28 AM
newusers command from a file scoobydude Linux - General 2 05-30-2005 07:44 PM
newusers input file format? Pizentios Linux - General 2 04-13-2005 02:27 PM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 07:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:41 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration