- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Set password script
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
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
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-12-2005 06:32 AM
тАО07-12-2005 06:32 AM
I do not wish to install "expect" to do this. I am looking for perl code to set a user's password to some pre-determined inital value, wehreby the user will have to change their password the first time they login after that.
Solved! Go to Solution.
- Tags:
- Password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-12-2005 06:37 AM
тАО07-12-2005 06:37 AM
Re: Set password script
- Tags:
- crypt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-12-2005 07:15 AM
тАО07-12-2005 07:15 AM
Solution/usr/sam/lbin/usermod.sam -p "Dx3zsaXO3q22." username
I don't think any portion needs any explanation on this command.
UNIX because I majored in cryptology...
- Tags:
- usermod.sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-12-2005 08:37 AM
тАО07-12-2005 08:37 AM
Re: Set password script
I tried several different iterations of piping, reading from stdin, and other hacks to see if I could pump data into the passwd command itself. But I firmly believe that the passwd command attempts to open the tty directly somehow using the tty driver (doesn't use stdin when reading a password from the user). I even tried to fake it out by putting it in a tty-less environment while using stdin to feed data to passwd. The passwd command still refused to read from a pipe or from any specific file descriptor. Therefore, it appears that the best solution would be to generate a predefined hash (and possibly use the usermod.sam utility to plug it in to the password file). I tested the usermod.sam command on both a trusted and a non-trusted system and it seems to work in both cases. Note that the hash format (including the strings which control aging and expiration in the hash) are pretty well documented in the passwd(4) man page.
-- Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2005 12:57 PM
тАО07-14-2005 12:57 PM
Re: Set password script
You can use crypt to generate the password
or you can clip a default one thats incrypted out of the password or trusted /tcb/ directory files.
If you use a default one though make sure you run an extra command to force the users to change it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2005 01:11 PM
тАО07-14-2005 01:11 PM
Re: Set password script
echo "password1b" |/usr/lib/makekey
supbstitute the output into the usermodsam command and you can automate the whole thing :).
Note to use 8 char password 2 char salt when doing this.
Points are welcome