- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Scripting Question
Operating System - HP-UX
1753416
Members
5154
Online
108793
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
Discussions
Discussions
Forums
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
тАО03-15-2005 10:41 PM
тАО03-15-2005 10:41 PM
Scripting Question
Hi Experts,
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=837084
Pls see the above thread raised by me. I still awaiting for a complete solution for my proble. Its only partially solved.
Regards,
Syam
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=837084
Pls see the above thread raised by me. I still awaiting for a complete solution for my proble. Its only partially solved.
Regards,
Syam
- Tags:
- broken URL link
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2005 11:36 PM
тАО03-15-2005 11:36 PM
Re: Scripting Question
Syam,
I had another dig around, specifically for trusted system and have found:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=86321
Please read the man pages attached to that thread for modprpw.
If you need further examples, search the groups for "trusted passwd script"
Regards
I had another dig around, specifically for trusted system and have found:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=86321
Please read the man pages attached to that thread for modprpw.
If you need further examples, search the groups for "trusted passwd script"
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2005 09:01 AM
тАО03-18-2005 09:01 AM
Re: Scripting Question
Syam,
This is totally unsupported and you'd be trying at your own risk, but;
If you can encrypt the password you want to use, copy it say from a test login then you could amend the following in Peter's script
useradd -c "$username" -g dbuser -m -s /usr/bin/ksh -k /etc/skel -d /home/$logid $logid
# This is the risky part
TMPPW=`find /tcb/files/auth -name $logid`
ed $TMPPW << EOF
/pwd
s/\=.*\:/\=YOURTEMPW\:/
w
q
EOF
passwd -f $logid
echo "Created user $username"
done < user.dat
So basically you're setting TMPPW to be the path to the user's TCB file, then doing an 'ed' on the file to substitute your temporary password in the u_pwd field. The line s/\=.*\:/\=YOURTEMPW\:/ is substituting everything between the = and the : with YOURTEMPW (which is your encrypted password). Then you do a passwd -f to force the user to pick a new password.
Why is it risky, because it's not a supported method, so make sure you backup things first.
Good luck
Robert
This is totally unsupported and you'd be trying at your own risk, but;
If you can encrypt the password you want to use, copy it say from a test login then you could amend the following in Peter's script
useradd -c "$username" -g dbuser -m -s /usr/bin/ksh -k /etc/skel -d /home/$logid $logid
# This is the risky part
TMPPW=`find /tcb/files/auth -name $logid`
ed $TMPPW << EOF
/pwd
s/\=.*\:/\=YOURTEMPW\:/
w
q
EOF
passwd -f $logid
echo "Created user $username"
done < user.dat
So basically you're setting TMPPW to be the path to the user's TCB file, then doing an 'ed' on the file to substitute your temporary password in the u_pwd field. The line s/\=.*\:/\=YOURTEMPW\:/ is substituting everything between the = and the : with YOURTEMPW (which is your encrypted password). Then you do a passwd -f to force the user to pick a new password.
Why is it risky, because it's not a supported method, so make sure you backup things first.
Good luck
Robert
Time to smoke and joke
- Tags:
- useradd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2005 06:00 PM
тАО03-19-2005 06:00 PM
Re: Scripting Question
Hi ,
Hi I couldn't go through the second post or test that.My problem was already solved.
I modified my script again as follows and it is now able to server my purpose. Thanks for all.
############################################################
#!/usr/bin/sh
groupadd dbuser
rm -f passwords.dat
#read all the data in the file user.dat
while read data
do
#split the fields up
#first field
logid=`echo $data | cut -d' ' -f1`
#second field onwards
username=`echo $data | cut -d' ' -f2-`
useradd -c "$username" -g dbuser -m -s /usr/bin/ksh -k /etc/skel -d /home/db$logid db$logid
/usr/lbin/modprpw -x db$logid >> passwords.dat
echo "Created user $username"
done < user.dat
cat passwords.dat|cut -f2 -d"=">passwords.txt
rm -f passwords.dat
########################################################
The above script stored the initial passwords in a txt file called passwords.txt. I only need to do cat passwords.txt and copy paste to excel.
My Problem is solved.
Closing this thread. Thanks all who replied.
regards,
Syam
Hi I couldn't go through the second post or test that.My problem was already solved.
I modified my script again as follows and it is now able to server my purpose. Thanks for all.
############################################################
#!/usr/bin/sh
groupadd dbuser
rm -f passwords.dat
#read all the data in the file user.dat
while read data
do
#split the fields up
#first field
logid=`echo $data | cut -d' ' -f1`
#second field onwards
username=`echo $data | cut -d' ' -f2-`
useradd -c "$username" -g dbuser -m -s /usr/bin/ksh -k /etc/skel -d /home/db$logid db$logid
/usr/lbin/modprpw -x db$logid >> passwords.dat
echo "Created user $username"
done < user.dat
cat passwords.dat|cut -f2 -d"=">passwords.txt
rm -f passwords.dat
########################################################
The above script stored the initial passwords in a txt file called passwords.txt. I only need to do cat passwords.txt and copy paste to excel.
My Problem is solved.
Closing this thread. Thanks all who replied.
regards,
Syam
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP