Operating System - OpenVMS
1753512 Members
5540 Online
108795 Solutions
New Discussion юеВ

Change openVMS password through external application (VC++)

 
SOLVED
Go to solution
nandha
Occasional Contributor

Change openVMS password through external application (VC++)

Hi,

I want to develop a application using C++ / VC++ (Windows application), through which i should be able to change the openVMS password.

how to change the openVMS password through C++,
please let me know what step i need to follow, and if any code available , pleas let me know.

Thanks and Regards
Nandha
4 REPLIES 4
Hein van den Heuvel
Honored Contributor

Re: Change openVMS password through external application (VC++)

Change the password 3rd party, or for oneself?

KISS... run a psuedo-telnet session from the windows application to VMS box using the old password to login, prompting for the new. Use all the window drssing you like, but let VMS do the validation and setting.
No VMS code, just windoze code.

fwiw,
Hein.
John Gillings
Honored Contributor

Re: Change openVMS password through external application (VC++)

Nandha,

This can be done, but if you want to do it properly (ie: impose dictionary checks, local policies, maintain history lifetime, generate audits and/or alarms etc...) it gets very complex. There's also the issue of "how can I (your user) trust that you won't capture and store my password?" If you're external to the box, how will the characters get transferred to the VMS system in a secure manner?

The easiest way to make it happen correctly and securely is a login session with /NEW_PASSWORD




A crucible of informative mistakes
nandha
Occasional Contributor

Re: Change openVMS password through external application (VC++)

Hi,

Thanks a lot for your reply,

I'll explain something more about my query,

We are having a Business application which is running in a Windows NT machine (developed in C++/VC++), and Data base (DB) is in openVMS,

And through ODBC connection our application talks to VMS and get the data.

If the password of VMS expire are not able to do anything through ODBC, we just get a message says that password expires,


So now we are suppose to develop a utility to our business application (Windows NT), which will communicate to the VMS and change the password of VMS. (This is not for any 3rd party.., it is for ourself, and no problem with the security issue all this machine are in our LAN connection, so no issue about the security and hacking password)

I tried as Hein said.. , connected to the Telnet (using port 23) and using new_passowrd i tried changing the password, hmm it was a crude way i wrote the program..,

i would like to get some more information about the step to do this and also about the error's to be handled.

Thanks and Regards
Nandha
Hein van den Heuvel
Honored Contributor
Solution

Re: Change openVMS password through external application (VC++)

Well, you would have to write a program which implement enough of the Telnet protocol to open port 23 to the VMS host and talk to it.

Also check out the 'expect' tool.

Error handling would be mostly returned string based.
Pass back to user and make them try again.
Check out chapter 1.6 "Login Failures" in then OpenVMS Userguide to get going.

http://h71000.www7.hp.com/doc/731FINAL/6489/6489pro_001.html#login_failures

For more help with the program... well that would be serious work which I and other would be happy to undertake for a reasonable financial compensation. Recognition point in the ITRC forum will not be enough :-)

I would start by downloading existing telnet clients:
For examples:
http://en.wikipedia.org/wiki/TELNET#Free_with_Source_Code

Actually I would probably use PERL
Something along the lines of:

use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>10,
Errmode=>'die');
$telnet->open('your.vms.host');
$telnet->waitfor('/Username: $/i');
$telnet->print($username_from_screen."/NEW_PASSWORD");
$telnet->waitfor('/Password: $/i');
$telnet->print($old_password);
$telnet->waitfor('/New password:$/i');
$telnet->print($new_password);
$output = $telnet->waitfor('/Verification: $/i');
print $output;
$telnet->print("logout"); # probably hardcoded for odbc users already


see: perl cookbook, chapter 18.6. Simulating Telnet from a Program
or: http://www.perlfect.com/articles/telnet.shtml

Be sure to take John's advise at heart:

OpenVMS userguid: 1.7.5 Changing Passwords at Login
"Even if your current password has not yet expired, you can change your password when you log in to the system by including the /NEW_PASSWORD qualifier with your user name. When you enter the /NEW_PASSWORD qualifier after your user name, the system prompts you to set a new password immediately after login.

The following example shows how to change your password when you log in:
WILLOW - A member of the Forest Cluster

Username: RWOODS/NEW_PASSWORD
Password:
Welcome to OpenVMS on node WILLOW
Last interactive login on Tuesday, 7-NOV-2002 10:20
Last non-interactive login on Monday, 6-NOV-2002 14:20

Your password has expired; you must set a new password to log in
New password:
Verification:
"

Also read the rest of : Sections 1.1 - 1.9
http://h71000.www7.hp.com/doc/731FINAL/6489/6489pro.html#logging_in_system_sect

Good luck!

Regards,
Hein van den Heuvel