- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- useradd command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
- 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
- Report Inappropriate Content
тАО06-09-2011 08:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- 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
- 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
- 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
- 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.