Encrypting/Decrypting passwords


 
Thread Tools Search this Thread
Top Forums Programming Encrypting/Decrypting passwords
# 1  
Old 05-06-2013
Question Encrypting/Decrypting passwords

I know that simply encrypting and decrypting passwords in a script is as bad as storing them in plain text, but I've been searching for an answer to this for a few days now, and haven't found an answer that fits the problem I'm having.

Here's the scenario. I'll give more details than I think may be relevant, just in case...

I have a VMware Management Assistant machine running SuSE Enterprise 11, which in turn is talking to an APC UPS. When the UPS goes to battery power it is set to run a script that will gracefully shutdown the VMware virtual machines running on an ESXi cluster. In order to do this the script needs to be able to automatically login to the ESXi machines using a local (to the ESXi machines) username/password combo.

I've written the script to handle the shutdowns in Perl using VMware's API, but the username/password issue has me stumped. Prompting for a password won't work as I need it to run automatically (what happens if the power goes out and no one is around to enter the password?).

I'm at quite a loss as to how to handle this situation. I know I could hash the password using something like Authen::Passphrase::BlowfishCrypt, but how would I then pass it to the ESXi host for the login? Am I maybe approaching this whole thing from the wrong direction, or is there a solution that I'm just not seeing?

Thanks in advance for your help.
# 2  
Old 05-06-2013
There are widely used ways to automatically and securely log into remote systems using public and private keys that are stored in files. It's been a while, so I don't remember the details, but I used ssh-keygen to set it up, and there are many tutorials to show how to do it. Perhaps that might work for you, if it's compatible with your situation and you have not already tried it.
This User Gave Thanks to hanson44 For This Post:
# 3  
Old 05-06-2013
Have you looked at vCLI (vSphere command Line Interface)? The vicfg-hostops interface can do what you are looking to do.

Code:
vicfg-hostops [<conn_options>]
       [--action [suspend|poweroff] |
        --cluster |
        --datacenter |
        --force |
        --operation [enter | exit | shutdown | reboot | info] ]

This User Gave Thanks to fpmurphy For This Post:
# 4  
Old 05-07-2013
@hanson44 - Thanks, I'll have to check into that, I had completely forgotten about ssh-keygen, been in the Windows world for too long.

@fpmurphy - Thanks for the pointer to vCLI, it looks like that may be just the ticket, once I figure out how to use the credstore.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. High Performance Computing

Encrypting interconnect

Hi, i've got a qusetion regarding interconnect of compute nodes. In our company we are running a Simulation Cluster which is administrated by the Simulation department. Now our central IT requires to encrypt the interconnect of the compute nodes. Does anybody in that business encrypt... (3 Replies)
Discussion started by: fiberkill
3 Replies

2. UNIX for Advanced & Expert Users

How To Find GPG Keys In Encrypted File With Out Decrypting it?

Hello All, Is there a way to determine how many public keys are embedded or used to encrypt in a GPG file with out decrypting the actual encrypted file. I know i can see the keys & email id's used when we decrypt it, but curious to find a command if any to know with out decrypting the actual file... (2 Replies)
Discussion started by: Ariean
2 Replies

3. Shell Programming and Scripting

Shell Script for encrypting/decrypting text file

Hello, I am a newbie in Shell scripting. At the moment, I have a program written in C++ which gives an output file in text format. I would like to write a shell program which can take that output file and encrypt it and later if needed I want to decrypt it. Could someone please help or... (3 Replies)
Discussion started by: Tanin
3 Replies

4. UNIX for Advanced & Expert Users

When did UNIX start using encrypted passwords, and not displaying passwords when you type them in?

I've been using various versions of UNIX and Linux since 1993, and I've never run across one that showed your password as you type it in when you log in, or one that stored passwords in plain text rather than encrypted. I'm writing a script for work for a security audit, and two of the... (5 Replies)
Discussion started by: Anne Neville
5 Replies

5. Shell Programming and Scripting

Ignoring file name case and decrypting it.

Dear Friends, I want to decrypt 2 different file types in a folder (ZIP files and GPG files). Each file type need different decryption syntex. Hence, the script should identify file type and should act accordingly ignoring file name case i.e. upper or lower case. Also, the extention can be... (6 Replies)
Discussion started by: anushree.a
6 Replies

6. HP-UX

Encrypting DataBase Passwords

Hi All We have got a HUGE process of securing our infrastructure(primarily the database) We basically establish connection to oracle database from our UNIX shell scripts when we do ps -ef | grep sqlplus it blurts out all the credentials as output. sqplus username/password@server ... (1 Reply)
Discussion started by: b_sri
1 Replies

7. Shell Programming and Scripting

decrypting a file using shell script

how do you go about doing this i have a shell script here below but i am not to sure on the process of decrytpting the file. #!/bin/csh # # set am = ‘abcdefghijklm' set am = ‘ABCDEFGHIJKLM' set nz = ‘nopqrstuvwxyz' set NZ = ‘NOPQRSTUVWXYZ' cat $argv | tr $am $AM | tr $NZ $nz | tr $nz $am... (1 Reply)
Discussion started by: master_6ez
1 Replies

8. Shell Programming and Scripting

Decrypting Unix file

Accidentally, I encrypted a file while saving it in vi editor. While saving I used :X and when asked for encryption key, I simply pressed ENTER key without any input. Now, I want to decrypt the file. I searched the forum, but unfortunately didn't get the proper solution. In one of the... (1 Reply)
Discussion started by: rkkiran
1 Replies

9. Shell Programming and Scripting

decrypting a file

Accidentally, I encrypted a file while saving it in vi editor. While saving I used :X and when asked for encryption key, I simply pressed ENTER key without any input. I searched the forum, but unfortunately didn't get the proper solution. In one of the threads it asked to visit a particular... (1 Reply)
Discussion started by: rkkiran
1 Replies
Login or Register to Ask a Question