- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Change passwd in automatic form
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
08-03-2005 04:22 AM
08-03-2005 04:22 AM
Change passwd in automatic form
Hi,
As change the passwd to a group of accounts in automatic form?
S.O: HP-UX 11i
Thank in advance
Jorge Prado T
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2005 04:27 AM
08-03-2005 04:27 AM
Re: Change passwd in automatic form
it's not possible with the shell because the passwd command in interactive, but you can write a C program that generate the password crypted and replace the /etc/passwd.
DM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2005 04:36 AM
08-03-2005 04:36 AM
Re: Change passwd in automatic form
/usr/sam/lbin/usermod.sam -p "Dx3zsaXO3q22." username
where the string in the double quotes is your encrypted password.
This method works on both trusted and untrusted systems but keep in mind that it is not a supported way by hp and the usermod.sam module can go away in later releases of th HPUX. So use it with caution.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2005 05:22 AM
08-03-2005 05:22 AM
Re: Change passwd in automatic form
You'd have to adjust for your specific situation, but here are my old notes on this:
1. Take a dummy account and key in the new password to get the encrypted password...
Here's the basic script we tested with:
newpass="
cat /etc/passwd | while read line #read /etc/passwd line by line
do
echo $line | grep -q '^[A-Z][A-Z]*:[^:]*,3\.\.\.:' #see if it matches the criteria
if [ $? -eq 0 ]
then #now replace old passwd for new passwd and print line
username=`echo $line | cut -d: -f1`
therest=`echo $line | cut -d: -f 3-`
echo $username:$newpass:$therest
else #print unmodified lines
echo $line
fi
done
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 04:29 AM
08-04-2005 04:29 AM
Re: Change passwd in automatic form
Here is a link:
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.43/
As far as I know it is the only scripting language that will allow you to script password changes.
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 04:36 AM
08-04-2005 04:36 AM
Re: Change passwd in automatic form
If you're familiar with perl, the expect moduleis an excellent solution for this as well. Probably not worth learning if this is the only time you'll ever have to do it; however, it does come in handy. All the power of expect with the syntax of perl. Can't be beat.
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html