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!

Encrypting my .SH file to prevent ppl from CATing the contents

Status
Not open for further replies.

dreamaz

Technical User
Dec 18, 2002
184
0
0
CA
How can i encrypt/compile this so that people cant CAT my .sh file?

I see some other scripts on our system with a .sh.x and when i cat it its all encrypted

Any ideas?

Thanks
 
Hi

No kidding. If you can not read a file, then nether the shell can. Those files probably are compressed and there is one command in "clear", which uncompresses the content and passes it to the shell.

Feherke.
 
If you want to make scripts unreadable then your friend is sudo (assuming you have root access)
[ol]
[li]Create the script, for example myscript.ksh in /usr/local/bin[/li]
[li]chmod 700 myscript.ksh - the script is now only readable by root.[/li]
[li]Add the line to the sudoers file
Code:
ALL myhost=/usr/local/bin/myscript.ksh
[/li]
[/ol]
I use a similar method to protect scripts which have hardcoded passwords (ugh!) in them. For added security you might want to create /usr/local/secure_bin with 700 permissions to store these files.

It's far from perfect but it's simple to implement.

Ceci n'est pas une signature
Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top