Create a "chat" user on the server host with the adduser utility.
Add a Match directive to the very end of /etc/ssh/sshd_config to run netcat
as an intermediary for "chat" logins. It is important to place the Match
directive at the end of the file to avoid affecting other logins.
Match User chat
ForceCommand nc 127.0.0.1 8000
Restart sshd with
kill -HUP cat /var/run/sshd.pid
Check to make sure the daemon has restarted before you logout of your
current ssh session! If you make a typo in sshd_config, sshd will fail to
restart, silently, and you will no longer be able to connect to the system
as any user! To verify sshd has restarted, open another xterm or virtual
console and attempt to login as the "chat" user:
Create the file /home/chat/.hushlogin to suppress printing of the last
login time and message of the day.
Chattahoochie writes its pid into /var/run/chattahoochie.pid if it can
(ie., it is started as root), and may be stopped with a SIGTERM. A rc.d
script is provided and installed in /usr/local/etc/rc.d/. Add the
following lines to /etc/rc.conf to start chattahoochie on system boot-up.
Replace the items in brackets with values appropriate for your system,
and/or add or remove options as suits your system. The available options
are described in full at the end of this manual page.
chattahoochie_flags="-u <user> -g <group>"
Once your /etc/rc.conf is configured you may start, stop, or restart chattahoochie,
or determine if it is running with the following commands:
If you do not want chattahoochie started on system start, then set
and use the following commands:
If the server encounters an error reading or writing data to or from
a client, or runs out of memory, the particular connection which generated
the error will be dropped. All other errors will be logged via syslog(3),
and may be found in /var/log/messages.
The following arguments are recognized. They are
The -p option specifies the port to listen on. This defaults to 8000 if
By default, chattahoochie accepts connections on all interfaces it can find capable
of IPv4 or IPv6. The -i option, when present, overrides this behavior, by
limiting chattahoochie to accepting connections from a specified interface only.
The option accepts the IP address of the desired interface as an argument.
The address must be expressed in the presentation format for either IPv4 or
The -m option specifies the maximum number of clients which may be connected
at any one time. If not specified, this value defaults to 5.
The -u and the -g options may be used to specify the user and group for
the server to change to after it has bound to the listening socket. If not
specified, both values default to "nobody". Note that in order for the
server to change user the server must be started as root. If not started
as root, two error messages will be syslog()ed at start-up, complaining
about the inability of the server to change user and group. You can
suppress them by providing values to -u and -g to override the default
"nobody" with the actual user and group under which the server runs.
The -x option, if present, prevents chattahoochie from becoming a daemon. It will
then run in the foreground of the terminal where it was started, and may be
stopped with signals (ie., Control-C). The server also will not write its
pid to /var/run/chattahoochie.pid when the -x option is used.