LinuxCommandLibrary

shc

TLDR

Compile shell script

$ shc -f [script.sh]
copy
Set expiration date
$ shc -e [31/12/2025] -f [script.sh]
copy
Set expiration message
$ shc -m "[Script expired]" -f [script.sh]
copy
Custom output name
$ shc -o [binary] -f [script.sh]
copy
Relaxed security
$ shc -r -f [script.sh]
copy
Verbose output
$ shc -v -f [script.sh]
copy

SYNOPSIS

shc [-f script] [-o output] [-e date] [-m message] [options]

DESCRIPTION

shc compiles shell scripts to binaries. It provides basic source code protection.
The script is encrypted and wrapped in C code. Compilation produces an executable.
Expiration dates limit script lifetime. Useful for time-limited distribution.
Relaxed mode allows running on different systems. Strict mode binds to current host.
The .x.c intermediate file contains C source. Can be inspected or modified.

PARAMETERS

-f SCRIPT

Input script.
-o FILE
Output binary.
-e DATE
Expiration date.
-m MESSAGE
Expiration message.
-r
Relaxed security.
-v
Verbose.
-T
Allow tracing.
-U
Untraceable mode.

CAVEATS

Not true compilation - script is recoverable. Security is obfuscation, not encryption. Requires C compiler.

HISTORY

shc (Shell Compiler) was created by Francisco Javier Rosales Garcia. It's used for basic shell script protection and distribution.

SEE ALSO

bash(1), gcc(1)

Copied to clipboard