LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


Gentlefolk,

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:

-bash-4.1$

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

/home/newaccount

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.

.bash_logout
.bash_profile
.bashrc

Is there any equivalent for the "newusers" command?

Thanks in advance.

***EDIT***
http://www.linuxquestions.org/questi...ectory-771049/

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
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
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.
 
  


Reply


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


All times are GMT -5. The time now is 02:00 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration