Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crypted shell script getting error

Status
Not open for further replies.

CaptNeo

Technical User
Jun 4, 2002
49
0
0
US
Hello all,

After I ran the crypt comand over a file and saved it to a new file, I'm getting this error after running the new file:
#./test.sh
./test.sh: syntax error at line 2: `)' unexpected

This is how I ran the crypt command:
# crypt password < run-test.sh > test.sh

I would like to ran the file but having it encrypted so no one could mess the script.

Any help would be appreciated.
 
I think you'd be better to choose a compiled language rather than a script.


Trojan.
 
You would have to decrypt the encrypted script again before running it...

decrypt-cmd < test.sh | ksh



HTH,

p5wizard
 
But I don't want to decrypt the file before running it again. I just want it to run encrypted so users won't have to decrypt it before running it. I don't want users to be able to edit the script (some are root users too) but be able to run it encrypted.
Any other advice?
 
Any other advice?
Don't write scripts but compiled programs.
 
I'm more flexible in writing shell scripts now than I used to do source codes in C.
 
The problem is that scripts are effectively open source.
And the shell needs them to be human readable to be able to process them.
So your best bet is probably to write your code that is secretive in C and if you want to minimise the pain then just keep that to a minimum and keep the rest in shell script.
Any tool you use to decrypt your script will obviously be available to any users of it. There is no security in shell scripts.
Food for thought for you.


Trojan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top