1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-15 04:05:15 +03:00
aports/testing/ssh-honeypot/ssh-honeypot.initd
2019-09-23 09:28:53 +02:00

23 lines
537 B
Text

#!/sbin/openrc-run
name="ssh-honeypot daemon"
description="Fake sshd that logs ip addresses, usernames, and passwords."
command=/usr/bin/ssh-honeypot
command_args="${SSHHONEYPOT_ARGS}"
prog_name="ssh-honeypot"
key_path="/usr/share/${prog_name}/honeypot.rsa"
pid_file="/var/run/${prog_name}.pid"
start_stop_daemon_args="-b -m --pidfile ${pidfile} -- "
depend() {
need net
}
start_pre() {
if ! checkpath -f "${key_path}"; then
ebegin "Generating key"
/usr/bin/ssh-keygen -t rsa -f ${key_path} -q -N ""
eend $?
fi
}