HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- useradd script on trusted system
Operating System - HP-UX
1828288
Members
3276
Online
109975
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
05-27-2003 07:19 PM
05-27-2003 07:19 PM
Hi,
I need to create 200 users under a trusted system. Is there any script available for this. My biggest concern is the default password for each acct created, how do I capture those from the useradd script. To go thru SAM is just too time consuming.
Thanking you in advance.
Regards
I need to create 200 users under a trusted system. Is there any script available for this. My biggest concern is the default password for each acct created, how do I capture those from the useradd script. To go thru SAM is just too time consuming.
Thanking you in advance.
Regards
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2003 07:45 PM
05-27-2003 07:45 PM
Solution
USER=$1
GROUP=$2
useradd -g $GROUP -d /users/$USER -s /usr/bin/ksh -m -k /etc/skel/$GROUP $USER
echo "\n\n$USER created and added to $GROUP\n"
AUTHNUM=`/usr/lbin/modprpw -x $USER|awk -F= '{print $2}'`
echo "\nAuthorization number for $USER is $AUTHNUM"
echo "Press return"
read ans
return
Try this.This is from :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x72bcd06ed8c8d4118fef0090279cd0f9,00.html.
test it out work like charm.
regards
mB
GROUP=$2
useradd -g $GROUP -d /users/$USER -s /usr/bin/ksh -m -k /etc/skel/$GROUP $USER
echo "\n\n$USER created and added to $GROUP\n"
AUTHNUM=`/usr/lbin/modprpw -x $USER|awk -F= '{print $2}'`
echo "\nAuthorization number for $USER is $AUTHNUM"
echo "Press return"
read ans
return
Try this.This is from :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x72bcd06ed8c8d4118fef0090279cd0f9,00.html.
test it out work like charm.
regards
mB
There are three person in my team-Me ,myself and I.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2003 07:53 PM
05-27-2003 07:53 PM
Re: useradd script on trusted system
Word of coutious:
1) you need a skeleton directory called /etc/skel/{GROUPNAME} .
if you don't like this just remove the -k option.Or point it to default skel : /etc/skel.
to run :
./test.sh username1 group1
test.sh = file which contain the script.
this will prompt the initial password.
Need to run using root.
regards
mB
1) you need a skeleton directory called /etc/skel/{GROUPNAME} .
if you don't like this just remove the -k option.Or point it to default skel : /etc/skel.
to run :
./test.sh username1 group1
test.sh = file which contain the script.
this will prompt the initial password.
Need to run using root.
regards
mB
There are three person in my team-Me ,myself and I.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 01:38 AM
05-28-2003 01:38 AM
Re: useradd script on trusted system
Thank you for the reply.
I've tried the script and found out that users' password expired even during 1st login. I checked the /etc/default/useradd and found out the last line was 'EXPIRE'. I then removed this entry and 1st login was fine.
Any idea how can I play aorund with the /etc/default/useradd, especially in setting the password expiration period for all the users.
Thank you.
I've tried the script and found out that users' password expired even during 1st login. I checked the /etc/default/useradd and found out the last line was 'EXPIRE'. I then removed this entry and 1st login was fine.
Any idea how can I play aorund with the /etc/default/useradd, especially in setting the password expiration period for all the users.
Thank you.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP