I am trying to install/configure and run sshguard on debian, I want to check if brute force attacks happen on my server.

I have installed it via apt-get, then I installed systemd and followed the following instructions for configuring https://wiki.archlinux.org/index.php/Sshguard (but those are for archlinux). when I type systemctl enable sshguard it does not work and I get Failed to issue method call: Unit name sshguard is not valid.

I know this should be a routine task, but it is the first time I have to work with daemon. This stuff is very new to me and I am lost in the documentation. I would like to configure the thing in a way that it default: it bans temporarily ip after 4 failed attempts and of course I would like to start the service at boot.

Maybe I can entirely forget about it because I intend to allow passwordless login (via public key exchange)

when I start sshguard with /etc/init.d/sshguard start , I get

[....] Starting sshguard (via systemctl): sshguard.serviceFailed to issue method call: Access denied failed!
  • What does sudo service sshguard start return? – terdon Oct 9 '13 at 15:22
  • sudo service sshguard restart works [ ok ] Restarting sshguard (via systemctl): sshguard.service. – simona Oct 10 '13 at 2:35

The way to manage services on Debian is to use the aptly named service:

$ sudo service sshguard status
$ sudo service sshguard start
$ sudo service sshguard restart
$ sudo service sshguard stop

To make a service start on boot, you can use sudo sysv-rc-conf which allows you to choose which services are active on each runlevel:

enter image description here

On Debian, the default runlevel is 2 so if you want a particular service to run on boot, activate it for runlevel 2.

  • sshguard has already enabled runlevel 2,3,4,5. what does it mean? – simona Oct 10 '13 at 2:34
  • @simona it means that it should start automatically next time you boot. Since sudo service sshguard start worked correctly, it should also be running now. – terdon Oct 10 '13 at 2:41
  • I don't see this command on Debian 7, has it been deprecated ? – valentt Jan 4 '14 at 19:38
  • @valentt you might need to install it sudo apt-get install sysv-rc-conf. – terdon Jan 4 '14 at 21:19

on Debian, daemons are started via:

/etc/init.d/sshguard start
  • how do I start it at boot? – simona Oct 9 '13 at 12:13
  • it will automatically be started. – umläute Oct 9 '13 at 12:46
  • how can I check if the process is running? – simona Oct 9 '13 at 14:53
  • Calling the init scripts directly is deprecated, use service instead. – terdon Oct 9 '13 at 15:22
  • @simona /etc/init.d/sshguard status or service sshguard status – umläute Oct 9 '13 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.