~/.rsh/config
/etc/rsh/rsh_config
rsh(1) obtains configuration data from the following sources in the following order:
- command-line options
- user's configuration file (~/.rsh/config)
- system-wide configuration file (/etc/rsh/rsh_config)
For each parameter, the first obtained value will be used. The configuration files contain sections separated by Host specifications, and that section is only applied for hosts that match one of the patterns given in the specification. The matched host name is the complete protocol://user@host:port/env/stack/service line given on the command line.
Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the file, and general defaults at the end.
The file contains keyword-argument pairs, one per line. Lines starting with
'#' and empty lines are interpreted as comments. Arguments may optionally be
enclosed in double quotes (") in order to represent arguments containing spaces.
Configuration options may be separated by whitespace or optional whitespace and
exactly one '='; the latter format is useful to avoid the need to quote
whitespace when specifying configuration options using -o
.
The possible keywords and their meanings are as follows (note that keywords are case-insensitive and arguments are case-sensitive):
-
Host
: Restricts the following declarations (up to the nextHost
keyword) to be only for those hosts that match one of the patterns given after the keyword. If more than one pattern is provided, they should be separated by whitespace. A single '*' as a pattern can be used to provide global defaults for all hosts. The host is the complete protocol://user@host:port/env/stack/service line given on the command line.A pattern entry may be negated by prefixing it with an exclamation mark ('!'). If a negated entry is matched, then the
Host
entry is ignored, regardless of whether any other patterns on the line match. Negated matches are therefore useful to provide exceptions for wildcard matches.See PATTERNS for more information on patterns.
-
Container
: Specifies how to choose the container to log in to. The argument may be one offirst
(use the first executable container),menu
(display a menu of the available containers), orauto
(display a menu only when there is more than one container and a TTY is requested). The default isfirst
. -
Environment
: Specifies the Rancher environment of the container to log in to. Arguments toEnvironment
accept the tokens described in the TOKENS section. The default is the name given on the command line. -
EscapeChar
: Sets the escape character (default: '~'). The escape character can also be set on the command line. The argument should be a single character, ornone
to disable the escape character entirely (making the connection transparent for binary data). -
HostName
: Specifies the real host name to log into. This can be used to specify nicknames or abbreviations for hosts. Arguments toHostName
accept the tokens described in the TOKENS section. Numeric IP addresses are also permitted (both on the command line and inHostName
specifications). The default is the name given on the command line. -
LogLevel
: Gives the verbosity level that is used when logging messages from rsh(1). The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. The default is INFO. DEBUG and DEBUG1 are equivalent. DEBUG2 and DEBUG3 each specify higher levels of verbose output. -
Port
: Specifies the port number to connect on the remote host. The default is 80 if the protocol is http, or 443 if the protocol is https. -
Protocol
: Specifies the protocol used to connect on the remote host. The argument may be one ofhttp
orhttps
. The default ishttps
. -
RemoteCommand
: Specifies the command to execute on the remote host instead of a login shell. Arguments toRemoteCommand
accept the tokens described in the TOKENS section. This can also be specified with the final argument on the command line. -
RequestTTY
: Specifies whether to request a pseudo-tty for the session. The argument may be one of:no
(never request a TTY),yes
(always request a TTY when standard input is a TTY),force
(always request a TTY) orauto
(request a TTY when opening a login session). This option mirrors the-t
and-T
flags for rsh(1). -
SendEnv
: Specifies what variables from the local environ(7) should be sent to the server. Note that the TERM environment variable is always sent whenever a pseudo-terminal is requested as it is required by the protocol. Variables are specified by name, which may contain wildcard characters. Multiple environment variables may be separated by whitespace or spread across multiple SendEnv directives. The default is not to send any environment variables.See PATTERNS for more information on patterns.
-
Service
: Specifies the Rancher service of the container to log in to. Arguments toService
accept the tokens described in the TOKENS section. The default is the name given on the command line. -
Stack
: Specifies the Rancher stack of the container to log in to. Arguments toStack
accept the tokens described in the TOKENS section. The default is the name given on the command line. -
User
: Specifies the user to log in as. This can be useful when a different user name is used on different containers. This saves the trouble of having to remember to give the user name on the command line.
A pattern consists of zero or more non-whitespace characters, '*' (a wildcard that matches zero or more characters), or '?' (a wildcard that matches exactly one character). For example, to specify a set of declarations for any host in the ".co.uk" set of domains, the following pattern could be used:
Host *.co.uk/*
The following pattern would match any host in the 192.168.0.[0-9] network range:
Host *192.168.0.?/*
A pattern-list is a comma-separated list of patterns. Patterns within pattern-lists may be negated by preceding them with an exclamation mark ('!'). For example, to match all hosts except production the following entry could be used:
Host !*prod.example.com/*,*.example.com/*
Arguments to some keywords can make use of tokens, which are expanded at runtime:
%% A literal '%'.
%e The remote environment.
%h The remote hostname.
%r The remote username.
%S The remote stack.
%s The remote service.
-
Environment
: accepts the tokens %%, %e, $S, and %s. -
HostName
: accepts the tokens %%, and %h. -
RemoteCommand
: accepts the tokens %%, and %r. -
Stack
: accepts the tokens %%, %e, $S, and %s. -
Service
: accepts the tokens %%, %e, $S, and %s.
-
~/.rsh/config
: This is the per-user configuration file. The file format and configuration options are described above. -
/etc/rsh/rsh_config
: Systemwide configuration file. The file format and configuration options are described above.
avvoenv is heavily inspired by OpenSSH, and portions of the man page have been directly copied. It is written and maintained by the Avvo Infrastructure Team [email protected].
rsh(1)