Skip to content

Commit

Permalink
Update extras
Browse files Browse the repository at this point in the history
  • Loading branch information
Freaky committed Mar 11, 2020
1 parent 766eb08 commit 8bb6756
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
19 changes: 18 additions & 1 deletion extra/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
tarssh: FreeBSD rc script
# `tarssh` extras

## `tarssh`

A FreeBSD rc script, with full `rc.conf` support.

## `tarssh.service`

An example systemd service file. The maintainer of `tarssh` is a FreeBSD user,
and cannot directly vouch for it.

## `tarssh_log_stats.rb`

A simple log parser to generate some statistics on the current run of the server,
giving a breakdown of how many clients have been connected and for how long.

Eventually this sort of functionality should be exported via a more structured
means from the server itself.
10 changes: 5 additions & 5 deletions extra/tarssh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# tarssh_log: The location for tarssh to log, default: "syslog"
# May also be set to an absolute path, or "NO" to disable
# tarssh_listen: host:port pairs to listen on, default:
# "0.0.0.0:22 \[::]:22" (all addresses on port 22)
# "0.0.0.0:22 [::]:22" (all addresses on port 22)
# tarssh_timeout (int): Network timeout in seconds, default: 30
# tarssh_delay (int): Time between tarpit messages in seconds, default 10
# tarssh_threads (bool, int): Whether to run in threaded mode, or a thread count,
Expand All @@ -37,7 +37,7 @@ start_cmd=start_cmd

: "${tarssh_enable:='NO'}"
: "${tarssh_log:='syslog'}"
: "${tarssh_listen:='0.0.0.0:22 \[::]:22'}"
: "${tarssh_listen:='0.0.0.0:22 [::]:22'}"
: "${tarssh_timeout:='30'}"
: "${tarssh_delay:='10'}"
: "${tarssh_threads:='NO'}"
Expand Down Expand Up @@ -67,14 +67,14 @@ start_cmd()

case "${tarssh_log}" in
syslog)
/usr/sbin/daemon -p "${pidfile}" -c -T "${name}" \
"${procname}" --disable-timestamps -v \
/usr/sbin/daemon -p "${pidfile}" -c -s info -T "${name}" \
"${procname}" --disable-log-timestamps --disable-log-level --disable-log-ident -v \
-l "${tarssh_listen}" -c "${tarssh_max_clients}" -d "${tarssh_delay}" \
-u "${tarssh_daemon_user}" --chroot "${tarssh_daemon_chroot}" $tarssh_threads
;;
/*)
/usr/sbin/daemon -p "${pidfile}" -c -o "${tarssh_log}" \
"${procname}" -v \
"${procname}" -v --disable-log-level \
-l "${tarssh_listen}" -c "${tarssh_max_clients}" -d "${tarssh_delay}" \
-u "${tarssh_daemon_user}" --chroot "${tarssh_daemon_chroot}" $tarssh_threads
;;
Expand Down
2 changes: 1 addition & 1 deletion extra/tarssh.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Documentation=https://github.com/Freaky/tarssh
Conflicts=ssh.service

[Service]
ExecStart=/usr/local/sbin/tarssh -v -l 0.0.0.0:22 --chroot /tmp/empty/ --user nobody --group nogroup --threads 1 -c 100
ExecStart=/usr/local/sbin/tarssh -v -l 0.0.0.0:22 -c 1024 --chroot /tmp/empty/ --user nobody
RestartSec=1min
KillSignal=SIGINT

Expand Down

0 comments on commit 8bb6756

Please sign in to comment.