aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ssh-honeypot/ssh-honeypot.initd
blob: f3ca11fd2b7d7fbe00ba433360d349a08014a6d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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
}