- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- non interactive passwd change
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
тАО05-20-2003 07:18 AM
тАО05-20-2003 07:18 AM
non interactive passwd change
Any idea
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2003 07:22 AM
тАО05-20-2003 07:22 AM
Re: non interactive passwd change
Expect is an advanced scripting language, made for jobs like this ;)
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2003 07:30 AM
тАО05-20-2003 07:30 AM
Re: non interactive passwd change
it is a scrip language based on TCL and makes this jobs very easy and robust.
SEE:
http://expect.nist.gov/
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2003 07:31 AM
тАО05-20-2003 07:31 AM
Re: non interactive passwd change
There currently is no command that will accept a username and password as arguments and change the user's password. However, this can be done programatically.
The following code is unsupported. However, this code should be used as an example, and should not to be taken as warranty that it is free from all defects.
Here is some C code that may be used to programmatically change a user's password on a non-trusted system. The major challenge with this is reading from the "/etc/passwd" file and modifying just one field of one line of that file.
The above two programs should be compiled and must be executed as the "root" user in order to access the non-trusted "/etc/passwd" file or trusted user's password information file.
The above programs may be modified to not accept two arguments, but instead accept just one argument as the password and have the code execute a getuid(2) to get the user id of the user executing the code, then run getpwuid(3C) to get the user's name, and act upon that user's information. For example:
:
strcpy(username, getpwuid(getuid())->pw_name);
strcpy(password, argv[1]);
:
Note: The argument count should also be modified to accept only one argument if this modification is used.
In order for this resulting executable (from the code which accepts just a password and no username argument) to be effectively used by users, the executable should be owned by root and have the setuid bit set, so it effectively runs as root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-20-2003 07:40 AM
тАО05-20-2003 07:40 AM
Re: non interactive passwd change
Change a passwd on system A and save the new passwd field. make sure that you know the new password value.
testdl1:RsC1T4xi7BQzo:113:20:test dl 1,,,:/home/testdl1:/usr/bin/sh
. cp /etc/passwd /etc/passwd.save.
. Use sed or cut to replace the field in the target passwd file to the new value in the new passwd file.
. copy the new passwd file back onto the old passwd file.
Passwords created on any hp-ux system are good on any other hp-ux system even though they may look different. If "dog" translates to "RsC1T4xi7BQzo" on system A, then "RsC1T4xi7BQzo" will crack back to "dog" on any other system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2003 11:47 AM
тАО05-22-2003 11:47 AM
Re: non interactive passwd change
As others have noted, expect is a good way to deal with this problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2003 11:50 AM
тАО05-22-2003 11:50 AM
Re: non interactive passwd change
See lckpwdf(3C), for example.