制作一个脚本,无论是shell脚本还是javascript模块,通过互联网公开提供给用户,还需要考虑什么?
我看到至少有两个相关的维度:
关于这些尺寸有哪些好的解决方案,还有哪些方面需要考虑?
特别适用于更复杂的shell脚本项目,具有多个子级可执行文件和依赖项。
答案 0 :(得分:1)
You may try using SHC encryption. SHC is a shell script compiler written in C programming language. The Shell Script Compiler (SHC) converts linux shell scripts directly into executable binaries. Compiling shell scripts into binaries provides protection against accidental changes, source modification and renders a way of hiding source code written in linux shell scripting language.
Syntax:
shc -f random.sh
will produce two files
random.sh.x
random.sh.xc
random.sh.x is the encrypted shell script in binary format
random.sh.x.c is the C source code of the random.sh file. This C source code is compiled to create the above encrypted random.sh.x file. The whole logic behind the shc is to convert the random.sh shell script to random.sh.x.c C program (and of course compile that to generate the random.sh.x executable)
You may rename random.sh.x to any name and run it after making it executable
答案 1 :(得分:0)
任何人都可以在文件系统上篡改shell脚本。要回答您的主要问题,将有助于了解将分配哪种环境。互联网?办公室?一间教室?
如果您计划通过互联网进行分发,将其托管在Github等源代码存储库中将有助于轻松访问。如果是在本地网络上,您可以尝试NFS挂载。
此外,运行shell脚本理论上应该只包括在脚本上设置可执行位(chmod +x
)然后执行它。任何需要定义的变量都应该事先完成。如果有任何要求用户更改它(例如,特定于用户的变量),应该立即显而易见。