Dear Ansa,
On Thu, Jul 24, 2008 at 2:11 PM, saeed ansari ansaperl@gmail.com wrote:
Hello Every one,
I am having one shell / perl script , through which i am doing all my server maintainance work like cleaning old logs etc. Script is running fine without any issues. But i am remotly login to almost 20 servers through this script and doing my stuffs for which i have to hardcode my user name and password (only one) in same scritp which i feel is scurity thread.
Is there any way to encrypt my password in the same script which system or script can understande but when any one else open my script not able to read that password line. Please note i am using Unix as OS and using vi editor.
Can any one please advice or guide me how to achieve this kind of encryption.
Please use SSH with Public Key to achieve this.
1. Generate a Public/Provate key pair on the system where your script is runing 2. On all target servers copy your public key to /home/user/.ssh/authorized_keys file 3. Now your script can invoke remote shell using SSH without any password (provided you have generated the key without any passphrase)
Thanks a lot for all your help and advice.
HTH
Regards, ansa
With regards, --Dinesh Shah :-) દિનેશ શાહ / दिनेश शाह Shah Micro System