Rebex Buru SFTP Server documentation

SSH shell commands (DEPRECATED)

SSH shell commands (legacy terminal mode) is deprecated. Use SSH terminal instead.

Custom shell commands can be enabled in the config.yaml. Commands can be found in aliases file.

Do NOT allow users to run commands that require user input. Such commands would effectively block the session as user input redirection is not supported.

Remember that users may use aliases to access files that are outside their root directory!

Windows impersonation disables custom shell commands for the user as impersonation is not supported for custom shell commands yet.

Syntax

# comment
mycommand1=path_to_exe arg1 arg2 arg3 ...
mycommand2=path_to_exe arg1 arg2 arg3 ...
...

Special parameters

  • $0- denotes the name of the command
  • $1 to $9 - denotes a positional parameter. Enclose in double quotes, unless you want to allow parameter splitting (see examples below).
  • $@ - expands the positional parameters, starting from one.
    • "$@": when the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$@" is equivalent to "$1" "$2" ....
    • $@: when the expansion is not within double quotes, each positional parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and pathname expansion.
  • $* - expands the positional parameters, starting from one.
    • "$*": when the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by space. That is, "$*" is equivalent to "$1 $2 ..."
    • $*: when the expansion is not within double quotes, each positional parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and pathname expansion.

Escape character (\)

Backslash is used to escape special characters - \ (backslash itself), " (double quote) and $ (dollar sign). When backslash is followed by a regular character, it is treated as a literal character (e.g. \a yields \a), so it can be used in Windows paths (e.g. C:\Windows).

Examples

Alias definition Command Result Comment
foo=C:\foo.exe "$1" foo "Hello World!" C:\foo.exe "Hello World!" Parameters will map one to one
foo=C:\foo.exe $1 foo "Hello World!" C:\foo.exe Hello World! Parameters will be expanded
do=cmd.exe /c "$@" do "dir /s" cmd.exe /c "dir /s"
do=cmd.exe /c "$*" do dir /s cmd.exe /c "dir /s"
whatever="$@" whatever git status "git" "status"
*="$0" "$@" git status "git" "status"

What next?

Download

Download fully functional free 30-day trial.

Free download

Non-commercial use

Get a free non-commercial license. It includes most of the features of Professional edition.

Get free license

Commercial use

If you use the server for anything related to business or commercial use you have to purchase a license.

Sales contact
sales@rebex.net

Buy a license

Get help

The server is completely free for personal, academy and other non-commercial use.

Technical support

support@rebex.net