- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Encrypting a 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
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
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
07-01-2011 03:03 AM
07-01-2011 03:03 AM
Encrypting a password
Is there any command in which I will be able to specify the encrypted password of a user and change the password?
- Tags:
- Password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2011 03:28 AM
07-01-2011 03:28 AM
Re: Encrypting a password
This topic may start you on your search:
http://h30499.www3.hp.com/t5/System-Administration/non-interactive-passwd/m-p/3784248#M263713
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2011 08:56 AM - edited 07-01-2011 09:01 AM
07-01-2011 08:56 AM - edited 07-01-2011 09:01 AM
Re: Encrypting a password
There is a way to create an encrypted password from HP-UX commands but it isn't simple:
typeset -L8 PW
(assign the desired password (8 characters or less) to PW. Passwords longer than 8 characters will require some programming and a look at the man page for bigcrypt(3c). Note that a standard HP-UX system (non-Trusted) will ignore characters in a password after the 8th character. A Trusted system will honor characters beyond 8 but makekey can't handle them.
The typeset -L8 will create a space filled character string for short passwords.
SALT=$( awk '
BEGIN {
CHARS="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"
srand()
printf("%s%s", substr(CHARS,1 + int(rand() * 64),1), \
substr(CHARS,1 + int(rand() * 64),1))
} ')
ENCRYPTED=$(echo "$PW$SALT" | tr -A " " "\000" | /usr/lbin/makekey)
The tr command changes the trailing spaces to nulls (required for makekey).
Now you can set/change the password using usermod -p like this:
/usr/sam/lbin/usermod.sam -p "$ENCRYPTED" userID
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2011 11:01 AM
07-02-2011 11:01 AM
Re: Encrypting a password
Hi:
Here's a simple Perl script to generate an encrypted password from a plaintext one:
# cat .pwgen
#!/usr/bin/perl -l
die "One arg expected\n" unless @ARGV;
print crypt(
$ARGV[0],
join( '',
( '.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z' )[ rand 64, rand 64 ] )
);
1;
...run as:
# ./pwgen plaintext
...to produce the corresponding encrypted password.
Regards!
...JRF...