- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: automating passwd in script
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
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
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-10-2001 03:38 PM
12-10-2001 03:38 PM
passwd $1 <<-END
$2
$2
END
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2001 03:41 PM
12-10-2001 03:41 PM
Re: automating passwd in script
To do what you want, look at the expect programing language.
However if you want to automate some scripts or something try .rhosts file or .shosts file (for ssh). Ssh would be preffered for security reasons.
GL,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2001 03:47 PM
12-10-2001 03:47 PM
SolutionWe had a discussion on this one before. Have a look at this thread.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x23cecf38d6bdd5118ff10090279cd0f9,00.html
I am using expect to automate the password changes across the systems with a combination of ssh.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2001 05:18 PM
12-10-2001 05:18 PM
Re: automating passwd in script
#include
#include
main(argc, argv)
int argc;
char *argv[];
{
char salt[3];
char *EncryptedPasswd;
int CheckRand;
int Fixup;
int SeedChar;
printf("\nUsage: pw
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-11-2001 01:55 AM
12-11-2001 01:55 AM
Re: automating passwd in script
It requires the ANSI C or GNU compiler - see the comments for more info.
Cheers,
Steve