- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: modprpw - with SUPPLIED password
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
12-19-2002 08:34 AM
12-19-2002 08:34 AM
I am trying to find a way (anyway really) to automatically change user account passwords to a specific password.
We have been using "modprpw -x" to expire an accounts password and assign a new RANDOM password. Ideally, I would love to find a way to use "modprpw" to change the password, however have the password changed to a SUPPLIED password.
I am willing to change and re-compile c code if necessary (I.E. encrypt.c, or use rsa.h, or whatever.)
It WILL NOT work to have the password changed to random and the user change the password when he/she logs in. These are accounts used by multiple people and (thus the rub) they are NOT allowed to change it (which is why we need to supply a password and have it automatically changed.)
There are a number of accounts, so changing the password manually would be a poor solution.
HELP! and thanks as always!
Mike
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 08:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 11:16 AM
12-19-2002 11:16 AM
Re: modprpw - with SUPPLIED password
Thanks for the info. Running into a snag however. We are using RSA on this box. Therefore, when I run the "/usr/sam/lbin/usermod.sam -p" command, it DOES change the password in the "/tcb/files/auth/
What appears to be happening is, when I use the "/usr/sam/lbin/usermod.sam -p" command, it appears to enter whatever I give it as the password parameter into the "/tcb/files/auth/
I am thinking I need to encrypt the password (according to the requirements of RSA and HPUX 11) and then offer the encrypted version of the password to the "/usr/sam/lbin/usermod.sam -p" command.
Does anyone know how to do this??
Thanks!
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 03:18 PM
12-19-2002 03:18 PM
Re: modprpw - with SUPPLIED password
It puts the same passwd(without encryption) into /tcb/files/auth/...username.
To get rid of this use a c program and by using crypt library you can encrypt the password and then use that in conjunction with usermod.sam.
It will definately work.
Let me know if you want that C program...I have written one.
Cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 03:51 PM
12-19-2002 03:51 PM
Re: modprpw - with SUPPLIED password
Thanks for the confirmation! I woudl DEFINITELY like that C program. I have been looking all over for one, and cannot find one which will do the job.
Can you just list the code here, on the forum? I should be able to cut, paste and can compile it on my machine.
Thanks! I greatly appreciate it!!
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 04:06 PM
12-19-2002 04:06 PM
Re: modprpw - with SUPPLIED password
#include
#include
#include
char *pass;
char *s = "JQ";
char *p = "hello123"; /* The password to be set */
main()
{
/* p = getpass(); Uncomment this line if you want password to be asked */
pass = crypt(p,s);
printf("%s\n", pass);
}
This is the program when you compile it and run it gives you an encrypted password which you can either paste in /tcb...or you can use /usr/sam/lbin/usermod.sam -p
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 04:16 PM
12-19-2002 04:16 PM
Re: modprpw - with SUPPLIED password
It compiled easily. I do have one additional question, not really being a C programmer. How would I change the code to allow the unencrypted password to be passed to the compiled encryption program.
Basically, I will be writing a fully automated script which will pull a non-encrypted password out of a file, pass it to the encryption program, take the encrypted return and change the password for the account using the usermod.sam command.
Thanks again! This has been a lifesaver!
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 04:23 PM
12-19-2002 04:23 PM
Re: modprpw - with SUPPLIED password
Like I said, not really a C programmer.
Thanks!
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 05:25 PM
12-19-2002 05:25 PM
Re: modprpw - with SUPPLIED password
#include
#include
/* 1st param is the desired password */
/* A random seed (2 chars) will be */
/* automatically chosen. */
/* For good passwords: */
/* Use random chars, mixed apha- */
/* numerics and MiXeD CaSe for */
/* better protection. */
main(argc, argv)
int argc;
char *argv[];
{
char salt[3];
char *EncryptedPasswd;
int CheckRand;
int Fixup;
int SeedChar;
printf("\nUsage: pw
/* Generate a random starting point for seed charcaters */
srand(time(NULL));
for ( SeedChar = 0; SeedChar <= 1; SeedChar++) {
CheckRand = 46 + rand() % 76; /* random number from 46 to 122 */
Fixup = 7 + rand() % 13; /* random number from 7 to 20 */
salt[SeedChar] = toascii(((CheckRand >= 58 && CheckRand <= 64) ||
(CheckRand >= 91 && CheckRand <= 96) ? CheckRand + Fixup : CheckRand));
}
EncryptedPasswd=crypt(argv[1], salt);
printf("\nRequested pw= %s, Automatic Seed= %s, encrypted pw= %s\n",
argv[1], salt, EncryptedPasswd);
}
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 08:38 PM
12-19-2002 08:38 PM
Re: modprpw - with SUPPLIED password
Sorry for the delay, i went out for friday lunch.
Here is what you probably want. Try this it should definately compile and work.
#include
#include
#include
char *pass;
char *s = "JQ";
char *p = "hello123"; /* The password to be set */
main()
{
p = getpass(); /* Uncomment this line if you want */
pass = crypt(p,s);
printf("%s\n", pass);
encrypt(pass,s);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2002 02:50 PM
12-20-2002 02:50 PM
Re: modprpw - with SUPPLIED password
Please assign points if the problem is soved to people you spent their valuable time for you.
Thanks
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2002 06:16 PM
12-20-2002 06:16 PM
Re: modprpw - with SUPPLIED password
The stinker works like a charm!! Thanks! I used the longer version of the encrypt.c, only for the random seeding. I managed to incorporate it beautifully into a series of scripts that keep the security high, and allows for a huge "password seeding" file.
Thanks again!
Mike