- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Adding multiple user accounts
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
Forums
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
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
тАО07-01-2008 10:01 AM
тАО07-01-2008 10:01 AM
I have very little knowlege of ksh programming, does anyone have a script that does something along those lines?
Thank you !!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2008 10:28 AM
тАО07-01-2008 10:28 AM
SolutionYou can take a simple route like
for i in 'cat users.dat'
do
useradd -m $i
done
Then you would have to set the passwords. I used expect to do a script that would add the user then add a standard password, but most systems dont have Expect.
Craig
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2008 10:29 AM
тАО07-01-2008 10:29 AM
Re: Adding multiple user accounts
You can do something like this:
# cat addusers
#!/usr/bin/sh
OLDIFS=${IFS}
IFS=":"
while read USER UID GID GECOS HOMEDIR THESHELL
do
echo useradd -u ${UID} -g ${GID} -c "\""${GECOS}"\"" -d ${HOMEDIR} -m -s ${THESHELL} ${USER}
done < newusers
IFS=${OLDIFS}
exit 0
# cat newusers
wade:500:20:wade at work:/home:/usr/bin/sh
wade2:501:20:wade at home:/home:/usr/bin/sh
...run as:
# ./addusers
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2008 10:30 AM
тАО07-01-2008 10:30 AM
Re: Adding multiple user accounts
username1
username2
username3
Craig
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2008 10:32 AM
тАО07-01-2008 10:32 AM