aliases
The aliases file defines custom commands available when the SSH shell type is set to legacy.
When a user runs a command that matches an alias name, the server executes the corresponding program with the specified arguments.
The file is located in the configuration directory.
A default file (aliases-default) with no aliases defined and an example file (aliases-example) are included for reference.
Aliases can execute arbitrary programs on the server. Users may use aliases to access files outside their path mappings. Do not define aliases that run programs requiring interactive user input — input/output redirection is not supported. Aliases are not available when Windows impersonation is enabled for the user.
Syntax
Each alias is defined on its own line. Lines starting with # are comments. Empty lines are ignored.
# ALIAS=COMMAND [ARG1 [ARG2 ...]]
mycommand=C:\tools\mytool.exe "$1"A wildcard alias (*) matches any command name not matched by an explicit alias.
Parameters
| Parameter | Description |
|---|---|
$0 | The command name. For a wildcard alias (*), this is the actual command entered by the user. |
$1 – $9 | Positional parameters. Enclose in double quotes (e.g. "$1") unless you want to allow word splitting. |
"$@" | All parameters, each expanded as a separate quoted word — equivalent to "$1" "$2" .... |
"$*" | All parameters joined into a single quoted word separated by spaces. |
$@, $* | All parameters, each expanded as a separate unquoted word. |
Escaping
The backslash (\) escapes \, ", and $.
When it precedes any other character, it is treated literally, so Windows paths like C:\Windows work without escaping.
Examples
# Run a specific executable with the first argument quoted
foo=C:\foo.exe "$1"
# foo "Hello World!" => C:\foo.exe "Hello World!"
# Same, but without quotes — the argument is split on spaces
foo=C:\foo.exe $1
# foo "Hello World!" => C:\foo.exe Hello World!
# Pass all arguments to cmd.exe as a single string ("$*" joins them)
do=cmd.exe /c "$*"
# do dir /s => cmd.exe /c "dir /s"
# Pass each argument as a separate quoted word ("$@" keeps them separate)
run="$@"
# run git status => "git" "status"
# Wildcard: forward any unmatched command to the OS
*="$0" "$@"
# git status => "git" "status"See also
- SSH Access — shell types and their behavior
sshShellreference — shell type configuration