Terminal legacy mode
Add custom commands to Rebex Buru Server SSH subsystem.
DEPRECATED
Terminal legacy mode is deprecated in favor of SSH terminal and will be removed in the future.
Custom shell commands can be enabled in the [config.yaml
]https://www.rebex.net/doc/buru-sftp-server/configuration/config/sshshell/). 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.
Users may use aliases to access files that are outside their path mapping!
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" |