RSH-GW(8)

NAME
rsh-gw - remote shell protocol proxy

SYNOPSIS
rsh-gw [-daemon <port>] [-fastdaemon <port>] [-as <tag>]

DESCRIPTION
The Firewall Toolkit rsh proxy is an application level proxy that provides configurable access control, authentication and logging mechanisms. The rsh proxy, which runs on the firewall, passes rsh requests through the firewall (at the application level), using rules you supply. You can configure the proxies to allow connections based on:

•   source IP address

•   source host name

•   destination IP address

•   destination host name

All packets, and therefore all application requests go to the firewall. On the firewall, the rsh proxy software relays information from one side of the firewall to the other. The proxy prevents the applications on outside networks from talking directly with the applications on your inside network, and vice versa. No IP packets pass from one side of the firewall to the other. All data are passed at the application level.

To use the proxy in non-transparent mode, rsh 'username' part should be substituted with username@host where @ is separator symbol which may be configured otherwise.

The rsh proxy (rsh-gw) generally runs as a daemon (invoked from system startup script, p.e. /etc/rc.local) and listens for requests on the specified port (tcp/512, as indicated in /etc/services ,is reasonable default). Whenever the system receives an rsh request on this port, the rsh proxy checks its configuration information (in the netperm-table) and determines whether the initiating host has permission to use rsh. If the host does not have permission, the proxy logs the connection attempt and displays an error message.

The proxy may also be invoked from tcp/ip "superserver" (inetd or xinetd). -daemon parameter should be omitted in this case.

If the host has permission the proxy logs the transaction and passes the request to the destination host.

OPTIONS

  Command Line Options
The rsh proxy recognizes the following command line options (whether started from the command line or from within /etc/rc.local):

-daemon port
    Indicates that the rsh proxy runs as a daemon, and the port (name or number) on which the rsh proxy listens. When -daemon option is used, configuration is being read from netperm-table for every new connection accepted by proxy.

    port Specifies either a numeric id or symbolic name from the /etc/services file.

-fastdaemon port
    Indicates that the rsh proxy runs as a daemon, and the port (name or number) on which the rsh proxy listens. When -fastdaemon option is used, configuration is being read from netperm-table once the daemon starts or if SIGHUP is received.

-as tag
    Changes default application tag for netperm-table from "rsh-gw" to any given string.

  Configuration Options
The rsh proxy reads configuration rules from the /usr/local/etc/netperm-table. It reads all rules using the rsh-gw and * (wildcard) keywords. The rsh proxy reads the netperm-table from top to bottom. If there are multiple rules in the table that could apply for a particular attribute, the rsh proxy uses the first one that it finds. See netperm-table(5) for a more complete explanation of netperm-table syntax and precedence.

The rsh proxy recognizes the following attributes:

user-limit number
    Specifies max permitted username length.

cmd-limit number
    Specifies max permitted command length.

hosts host-pattern [host-pattern...] [options]
    rules specify host and access permissions. Typically, a hosts rule will be in the form of:

    rsh-gw: deny-hosts unknown

    rsh-gw: hosts 192.33.112.* 192.94.214.*

    There may be several host patterns following the "hosts" keyword, ending with the first optional parameter beginning with '-'. Optional parameters permit the selective enabling or disabling of logging information, etc. Sub-options are:

    -transparent specifies that the proxy runs in transparent mode; see OS-specific details on how to setup transparent redirection. Proxy destination host is not extracted from username part but taken from connection properties instead. This makes proxy "transparent", so no special client setup is required.

    -plug-to server-address specifies that proxy is "hardwired" to a given server.

    -port server-port overrides default rsh port for plug-to

    -log specifies that a log entry to the system log should be made for rsh request.

    -dest pattern
    -dest {pattern [pattern..]}
    specifies a list of valid destinations. If no list is specified, all destinations are considered valid. The -dest list is processed in order as it appears on the options line. -dest entries preceeded with a '!' character are treated as negation entries. Therefore the rule:

    -dest !*.mit.edu -dest *

    will permit hosts that are not in the domain "mit.edu" to be connected to.

    -user username
    -user {username [username..]} specifies a list of users allowed to authenticate to remote server. By default, all users are permitted.

    -ausers username
    -ausers {username [username..]} Trust client local user identity (for extended permissions) for listed users. By default no identites are trusted and proxy operates as "unauth".

    -extnd specifies that the proxy should request per-operation permissions from authsrv.

    -xok specifies that rsh-gw may be used to start X11 gateway on the firewall via command " rsh firewall-host x "

    -separator separator-char specifies separator character used to distinguish user and host name parts in non-transparent mode (instead of default `@').

    -client-dscp dscp-tag-name
    -client-dscp dscp-hex-value specifies diffserv codepoint (QoS/ToS mark) for client to proxy connection.

    -server-dscp dscp-tag-name
    -server-dscp dscp-hex-value specifies diffserv codepoint (QoS/ToS mark) for proxy to server connection.

directory directory
    Specifies the directory that the rsh proxy makes its root directory before providing service.

groupid group
    Specifies the name of the group the rsh proxy uses when running.

    group
        Specifies either a name or numeric id from the /etc/group file.

timeout seconds
    Specifies the number of seconds the rsh proxy is idle (with no network activity) before disconnecting

userid user
    Specifies the user ID the proxy uses when running.

    user
        Specifies either a name or numeric id from the /etc/passwd file. This option is equivalent to the -user command in previous versions.

xforwarder x-gw
    Specifes X11 gateway executable file. x-gw binary should accept the following command line parameters:

    •   -from <ip-address> , the client ip

    •   -user <username> , the firewall user identity

    •   -display <display> , the client DISPLAY address (optional, default is <ip-address>:0.0)

EXAMPLES
Given the proxy is configured like:

    # permit workstations at LAN to access outside rsh servers
    rsh-gw: permit-hosts 10.0.0.*

, a sample rsh session via proxy may look like

    paranoid ~$ rsh -l johndoe@s1.illuminati.int firewall ls -l
    total 1780
    -rw------- 1 johndoe adm 1765460 Jan 26  2007 area51.dat
    paranoid ~$

FILES

/etc/rc.local
    Command script that controls automatic reboot, and includes startup information for the rsh proxy.

/usr/local/etc/netperm-table
    The network permissions file contains configuration information for the Firewall Toolkit, including the rsh proxy.

BUGS
Report bugs to arkenoi@gmail.com or fwtk-users@buoy.com mailing list. Include a complete example, explaining what you expected to happen and what actually happened. Be sure to indicate the type of system (operating system, hardware, etc.) you are using, as well as the version of the rsh proxy.

AUTHOR
ArkanoiD.

SEE ALSO
netperm-table(5), rc(8), authsrv(8), netacl(8), rlogin(1)