Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 24th February 2004, 03:10 AM
monkey Offline
Registered User
 
Join Date: Feb 2004
Posts: 8
Batch create users

After using newusers to batch create users with their passwords, say user01, user02, user03. I would like to know how can copy the startup scripts from /etc/skel to their home directories?
Because I have tried to use:
Code:
cp /etc/skel/* /home/user[1-3]
But seems not working. Can I use cp to do that? Or I can only use scripts to do so?
Thanks in advance.
Reply With Quote
  #2  
Old 24th February 2004, 03:37 AM
DaDevil Offline
Registered User
 
Join Date: Feb 2004
Posts: 25
All the files in the /etc/skel/ directory are hidden. Meaning they start with a "." .

So issuing the command

cp /etc/skel/* /home/test/

will result in
cp: cannot stat `/etc/skel/*': No such file or directory

So you can issue cp -R /etc/skel/.* /desired/path

Wait Wait do not run off to issue this command because if you do it you will discover that your whole goddamn /etc directory now resides in your /desired/path.

This is because of the ".." in every dir denoting the parent which unfortunately in this case is /etc/.

So the solution is

cp -R /etc/skel/.[a-z]* /desired/path

Note the "." after /skel/

Or better yet just copy them over individually by hand there are only a few of them. Just a question why do you need to copy them manually ? Won't newusers do that for you. Or am i mistaken in this? Since I am not so familiar with newusers.
Reply With Quote
  #3  
Old 24th February 2004, 04:12 AM
monkey Offline
Registered User
 
Join Date: Feb 2004
Posts: 8
Thanks DaDevil,

I found that when I use /home/user[1-3] as destination in cp command, the cp command will only do ONE set of copy for me, so if I have 3 users just like the above question - user01, user02, user03, only user03 will have those startup scripts in his home dir.

By the way, I have tried newusers, but what it has created for me is the user accounts (lines in /etc/passwd, corresponding lines in /etc/shadow) , their password and their home directories. It didn't copy the startup scripts for me. So is there any argument in newusers to do that? Am I missing something? Thanks.
Reply With Quote
  #4  
Old 24th February 2004, 04:26 AM
mhelios Offline
Retired Community Manager
 
Join Date: Feb 2004
Location: Queensland, AU
Posts: 736
monkey,

I realise you said you want to automate the process of adding multiple users, but FYI the `useradd` command will automatically copy the contents of /etc/skel to each new users home directory.
__________________
mhelios@fedoraforum.org
Registered Linux User # 348963
GnuPG KeyID: 0xCE9F8922
Reply With Quote
  #5  
Old 25th February 2004, 03:56 AM
monkey Offline
Registered User
 
Join Date: Feb 2004
Posts: 8
Thanks ... the `useradd` command will copy the startup scripts for me, then can I use useradd to create a batch of users? because I don't know how, and I can only add one per time.
Reply With Quote
Reply

Tags
batch, create, users

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL - Can't create new users M4rc0 Servers & Networking 10 15th September 2008 09:44 PM
help required in create a batch file jackal_79 Using Fedora 15 27th February 2008 12:22 AM
Unable to Create Users madnat Security and Privacy 5 26th February 2008 09:36 PM
i cant create users and now cant boot sheffrem Using Fedora 2 24th February 2007 05:13 PM
Can't create mysql db or users?? samfraser Using Fedora 1 8th February 2007 07:47 PM


Current GMT-time: 12:18 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat