- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Password change problem
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
10-31-2005 08:14 PM
10-31-2005 08:14 PM
Password change problem
I wrote an application in HP UX to change the password like passwd
command. When I try to change the password of a user, it asks for Old
password. Note that I am running my application as root. But in the
same michine the "passwd" command works fine.
Is there is any configuration file exist where I can put my
application name to work perfectly? Any one have any Idea about this?
Note: The same program works perfectly in all other machines including
AIX Linux etc.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2005 08:21 PM
10-31-2005 08:21 PM
Re: Password change problem
not sure which arguments u use with passwd, maybe u like to reply it in this post.
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2005 08:28 PM
10-31-2005 08:28 PM
Re: Password change problem
passwd -d username
passwd -f username
That might work.
HP-UX is proprietary
HP-UX works differently in certain ways.
I think that in spite of this its a better OS.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2005 08:41 PM
10-31-2005 08:41 PM
Re: Password change problem
I worte a program named "mypaswd" using PAM.
I enter the correct PAM configuration entry in /etc/pam.conf for my program.
entry looks like
mypasswd account required /usr/lib/security/libpam_unix.1
When I am trying to change the password using "mypasswd" program by entering
"mypasswd username"
It asks for old password.
Note that the source code of "mypasswd" is taken some open source implementation of passwd command using PAM. And it woks fine for all other platforms
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2005 08:17 PM
11-01-2005 08:17 PM
Re: Password change problem
Could you attach the source if it's open source so that we can examine it ?
TIA,
Marco
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2005 07:12 AM
11-02-2005 07:12 AM
Re: Password change problem
It is possible that the user passwd has reached the expiration time. change the passwd for that user manually and then try running the application if you want to change it again through your application. You should be fine. OR, disable passwd aging for this user.
Rgds
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2005 08:00 AM
11-02-2005 08:00 AM
Re: Password change problem
Is the server in trusted mode, in that case you need to edit the tcb database
goto /tcb/files/auth/r and vi the file root then remove the special characters u_pwd after that you can try to change the passwd and it will not ask for the old password.
If not a trusted system then you can edit the passwd file directly and remove the special characters. Make sure you alwyas make and a copy and have session logged in.
Rgds
HGN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2005 06:05 PM
11-06-2005 06:05 PM
Re: Password change problem
>>>Could you attach the source if it's open >>>source so that we can examine it ?
Here I am attaching the source
#include
#include
#include
#include
#include
/*
* PAM call back function to read the password values
*/
extern int convert(int num_msg,struct pam_message **msg,struct
pam_response **resp,void *appdata_ptr)
{
// Initialize PAM response object and set password
struct pam_response *temp;
temp = (struct pam_response *)calloc(num_msg,sizeof(struct
pam_response));
temp[0].resp_retcode = 0;
temp[0].resp = strdup((const char*)appdata_ptr);
*resp = temp;
return PAM_SUCCESS;
}
static struct pam_conv conv = {convert,NULL};
/*
* Function used to change the password of a user
*/
int changePasswd(char *user,char *pass)
{
pam_handle_t *pamh=NULL;
int retval;
struct pam_response *pp=NULL;
conv.appdata_ptr = pass;
// initialize PAM
retval = pam_start("myapp", user, &conv, &pamh);
if (retval == PAM_SUCCESS)
{
// Change password (auth tocken)
retval = pam_chauthtok(pamh, PAM_SILENT);
}
if (retval != PAM_SUCCESS)
{
return -1;
}
// End PAM Session
if (pam_end(pamh,retval) != PAM_SUCCESS)
{
pamh = NULL;
return -1;
}
return 0;
}
int main()
{
int res = changePasswd("user1","password");
printf( "Res = %d", res);
return 0;
}