New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Bash Script Encryption
I was wondering if there was a way to encrypt a bash file.
I have a bash script (setup.sh) file that I want to encrypt so that what it does is not readable by anyone that looks at the file.
Of course you can easily figure out what it does by looking at history or whatever, but I still wanna encrypt it.
Comments
http://www.thegeekstuff.com/2012/05/encrypt-bash-shell-script/
If you're asking for a way to encrypt the file so nobody can view it's source, but the file will still run then no. The shell needs to know the commands to run somehow, after all
EDIT: What the above link does isn't really encrypting it, it's more like compiling the script into a binary file- which isn't human readable.
Another approach to the problem (that I think you have), is to add your ansible vps public key to the host with a minimal bash script and then use ansible to execute tasks remotely.
Public-key crypto FTW.
(Of course, this would only be suitable for a project where all the hosts are your own)
If you decided to encrypt your shell script using shc, please remember that a smart person can still generate the original shell script from the encrypted binary that was created by shc.