Subject: | |
From: | |
Reply To: | |
Date: | Wed, 6 Mar 2013 22:36:44 -0500 |
Content-Type: | multipart/signed |
Parts/Attachments: |
|
|
On Mar 6, 2013, at 3:17 PM, SUBSCRIBE MACSCRPT Inyo55 <[log in to unmask]> wrote:
> Hey guys,
> I have a script that has to remotely do admin tasks on a Mac workstation. To that end, the shell script command string in the script has the secret password for the admin account in plain text. Is there anyway to hide this (other than locking the script)?
>
> Many thanks,
> Bob R.
you could try encoding the password, then set your variable to the result
#!/bin/bash
clear
echo ""
echo -e "\033[35;48m password is encypted as cGFzc3dvcmQK \033[35;0m";
echo "----------------------------------------------";
PASS=cGFzc3dvcmQK
dPASS=$(echo $PASS | openssl enc -base64 -d )
echo $PASS
echo $dPASS
you have to setup the encrypted password and hard code the encryption, then you can use the Varibable $dPASS in your string.
I first set my password to ' password' end encrypted it. like so;
echo "password" | openssl enc -base64
cGFzc3dvcmQK
or another
echo "frank" | openssl enc -base64
ZnJhbmsK
then you can decode with
echo "ZnJhbmsK" | openssl enc -base64 -d
frank
hope this helps
-j
|
|
|