- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- create user accounts in batch?
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
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
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
02-02-2005 06:55 AM
02-02-2005 06:55 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2005 07:01 AM
02-02-2005 07:01 AM
Re: create user accounts in batch?
Make a list of users, one per line.
sammy
schmo
bagel
call it userlist
script:
while read -r username
do
useradd $username
passwd $username
<< place code here to set password>> without input.
done < userlist
You might wish to have a temporary password list.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2005 07:04 AM
02-02-2005 07:04 AM
Re: create user accounts in batch?
Just to get you started..
Depot:
http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.42/
Small add user & change password script (untested):
#!/usr/local/bin/expect -f
set timeout -1
spawn $env(SHELL)
match_max 100000
expect -exact "# "
send -- "useradd username\r"
expect -exact "# "
send -- "passwd username\r"
expect -exact "Changing password for username"
New password: "
send -- "new\r"
expect -exact "\r
Re-enter new password: "
send -- "new\r"
expect -exact "\r
Passwd successfully changed\r
# "
expect eof
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2005 08:44 AM
02-02-2005 08:44 AM
Solution1) useradd (see above or man (1M)
2) /usr/sam/lbin/usermod.sam -F -p "" account_name
This will force the user to enter a new password when they log in the first time.
Best regards,
Kent M. Ostby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2005 01:29 AM
02-03-2005 01:29 AM