Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-26-2011, 05:36 PM   #1
LQ Newbie
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
Question Batch user creating with the "newusers" command question


I recently used the newusers command to generate several user accounts from a text file. That process seemed to go well until I tried to su into one of the new accounts.

su - newaccount

I was greated with the following:


I typed "pwd" to see if I was in the home directory and indeed I was.


This behavior appears for all the accounts that were created from the text file and the newusers command. It seems that several configuration files that should have been autogenerated for these new users were never created. I was able to confirm this was the problem by copying .bashrc and .bash_profile from a user that was created with the "useradd" command into the /home/newaccount directory. After logging off and logging into the newaccount again, the issue is corrected. I am greeted with the following:

newaccount@hostname ~$

Some recent google searching has guided me to the /etc/skel directory. Apparently when using the useradd command with the -m option files in the /etc/skel directory are copied to the new users home directory automatically.


Is there any equivalent for the "newusers" command?

Thanks in advance.


For the record, I just read this forum post and I'm looking for an alternative to this. If this is the most efficient way to accomplish my goal, then I'll try the route mentioned in the thread. I'm still open to alternatives.

Last edited by mainuser; 07-26-2011 at 05:46 PM. Reason: thread search turned up more results
Old 07-26-2011, 08:35 PM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,569

Rep: Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426
Well, looks like newusers doesn't have an option to specify using the skel dir, so if it doesn't use it, then yes, you'll need a short loop to cp the files for each user.


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
Need solution to "failed to fork PTY" and "error creating the child process" problems Gnusboy Linux - Newbie 4 01-02-2010 08:54 AM
Running command in gnome-terminal from script results in "...error creating child..." PlancksCnst Linux - General 6 04-08-2009 01:09 PM
question about creating the "linux" symlink when compiling kernel newbiesforever Linux - General 1 01-19-2009 06:04 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
Shell and batch operations on hidden files but not on ".." & "." danielsbrewer Linux - Software 5 09-12-2007 09:06 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:55 PM.

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