- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- System Administration
- >
- Re: useradd command
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-09-2011 07:40 PM
06-09-2011 07:40 PM
Solved! Go to Solution.
- Tags:
- useradd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-09-2011 08:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-09-2011 09:57 PM
06-09-2011 09:57 PM
Re: useradd command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-10-2011 12:32 AM
06-10-2011 12:32 AM
Re: useradd command
Yes, its very correct u can create N no of user in single command.
But its best practice is to create user one by one, so that if u want to give different parameters u can provide. like shell ,group etc.
Hope ur query resolved.
Regards
Vishnu Khandare
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-10-2011 03:39 AM
06-10-2011 03:39 AM
Re: useradd command
Creatre user file sample:
# cat /tmp/users.txt
user1
user2
...
# for USER in $(cat /tmp/user,txt)
do
useradd -g XX -s /usr/bin/ksh -m -d /home/$USER $USER
done
# man useradd
rgs,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-10-2011 06:03 AM
06-10-2011 06:03 AM
Re: useradd command
As given above, a simple "for" loop would do it for you, however with common options. In the other hand, you can have a more complex script which runs interactively and asks for the 'list' of user names and to choose options for them like group, shell etc.(many admins use scripts of this sort for user admin)
Still these will be creating the users "one by one" , not in a single shot. :D
todo lo mejor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-10-2011 09:03 PM
06-10-2011 09:03 PM
Re: useradd command
No, it is not possible to create 20 user accounts in one single command unless you create series of commands in a script file as given by rariasn. But this way you will have very limited/common options for each users and after creating all users, you will have to supply passwords one by one, can't do this in one go.
I would use simple way, copy previous command and edit to change username and other options instead writing scripts unless you have to use it frequently to create bunch of users on daily basis!!!
Was this post useful? - You may click the KUDOS! star to say thank you.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP