Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Install DenyHosts by placing its configuration at /etc/denyhosts.conf, adding your trusted administrator address to the allowed-hosts mechanism, and starting the daemon in SSH-only mode. DenyHosts watches SSH authentication failures and records offending hosts, traditionally enforcing blocks through /etc/hosts.deny. The safest deployment is to whitelist your management address before enabling blocking, then verify the daemon log and test from a separate connection.

What DenyHosts does on a Linux VPS

DenyHosts is a Python utility developed to reduce automated sshd brute-force attacks. It reads SSH authentication failures, counts attempts by host and account type, and denies hosts that cross configured thresholds. Traditional deployments write blocked addresses to /etc/hosts.deny, where the system’s host-access controls prevent the denied service from accepting connections.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This is a response mechanism, not a replacement for strong SSH configuration. Use key-based authentication, disable unnecessary accounts, keep the operating system patched, and restrict administrative access where practical. DenyHosts is most useful as an additional layer that reacts to repeated failures.

By default, configure it to protect SSH only. BLOCK_SERVICE = sshd limits enforcement to the SSH service; BLOCK_SERVICE = ALL is available when the intention is to deny every service covered by the host-access mechanism. Blocking every service is a materially broader decision and should be made only after checking how your operating system uses host access files.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Before you install: prevent locking yourself out

  • Have a second access path. Keep your VPS provider’s console or rescue access available while you change SSH defenses.
  • Identify the address you really use. If your home or office address changes frequently, whitelist the stable administration network or VPN egress address instead of a temporary one.
  • Confirm privileges. Source installation and daemon setup require root privileges or an equivalent administrative method.
  • Check Python dependencies. DenyHosts requires the ipaddr Python module, which is available in many Linux and BSD repositories.
  • Record the current SSH session. Do not close the working session until a new connection succeeds after the daemon starts.

The allowed-hosts mechanism must be configured before testing. Add every trusted administrator address before enabling daemon mode. A legitimate address that crosses a threshold can otherwise be written to the deny list and cut off your own access.

Where is denyhosts.conf?

On packaged Debian systems, the conventional configuration file is /etc/denyhosts.conf. A source installation does not create a usable configuration automatically: the project’s sample configuration must be copied to that path, or you must pass another path with the --config option.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the sample file as the authoritative list of supported settings for the release you install. It also identifies log and state paths, the allowed-hosts mechanism, optional integrations, and the daemon-control values that need to match your installation.

Choose a packaged or source installation

Distribution package

Many distributions provide a DenyHosts package. A package normally supplies the executable, a default configuration path, documentation, and sometimes a service unit. Package names, file locations, and service-unit names vary by distribution and release, so inspect the package’s manpage and installed files rather than assuming a universal command or unit name. On Debian, the manpage documents the packaged executable, /etc/denyhosts.conf, and the --config, --daemon, --purge, and --migrate options.

Source installation

Use the source procedure when your distribution does not provide a suitable package or when you need the project’s own control script. It gives you direct control over the configuration and daemon paths, but you must create those paths and arrange startup yourself.

Install DenyHosts from source

  1. Obtain and unpack a release. Download a release from the maintained DenyHosts project, verify that it is the release you intend to run, and unpack it on the VPS.
  2. Enter the release directory. Run the installation command from the directory containing setup.py.
  3. Install as root. Execute python setup.py install with administrative privileges. If the release’s documentation specifies a different supported interpreter invocation, follow that release-specific instruction.
  4. Install the dependency. Ensure the Python ipaddr module is available through your operating system’s repository or your approved Python package process before starting the daemon.
  5. Copy the sample configuration. Place the release’s sample configuration at /etc/denyhosts.conf. Do not start the daemon until this file exists and has been reviewed.
  6. Install the daemon-control script. Copy the distribution control script supplied with the release to the location you will use for administration. Set its DENYHOSTS_BIN, DENYHOSTS_LOCK, and DENYHOSTS_CFG paths to match the installed executable, lock file, and /etc/denyhosts.conf.
  7. Protect the control script. Make the script executable by root and ensure that unprivileged users cannot alter it. A modified control script can start DenyHosts with a different configuration or executable.

The source procedure deliberately leaves the exact sample-file and control-script filenames to the release you downloaded. Those names have changed between distributions; the installed release’s sample and documentation are the reliable reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Configure SSH blocking in /etc/denyhosts.conf

Open the configuration as root and set the policy before starting. The following settings are the important controls for a first deployment.

Setting Purpose Documented sample value or behavior
BLOCK_SERVICE Chooses which services are denied when a host is blocked. sshd limits blocks to SSH; ALL applies to every supported service.
DENY_THRESHOLD_INVALID Failures involving invalid users or otherwise invalid authentication attempts. Sample default: 5.
DENY_THRESHOLD_VALID Failures involving a valid account name. Sample default: 10.
DENY_THRESHOLD_ROOT Attempts targeting the root account. Sample default: 1.
DENY_THRESHOLD_RESTRICTED Attempts involving accounts covered by the restricted-user policy. Sample default: 1.
ALLOWED_HOSTS_HOSTNAME_LOOKUP Controls hostname lookups for entries in the allowed-hosts list. Sample default: NO; enable only when you understand the lookup and DNS implications.
PURGE_DENY Sets how long timestamped deny entries remain before they can expire. Examples include 1w and 5d.
DAEMON_PURGE Controls the interval at which daemon mode performs configured purge work. Example: 1h.
PURGE_THRESHOLD Limits how many times an address may be purged before remaining denied. Set according to your tolerance for repeat offenders; the sample file documents the exact behavior.

The four threshold numbers are sample defaults, not universal requirements. Lower values block faster but increase the chance that a mistyped password, monitoring probe, or shared NAT address is denied. Higher values tolerate more failures and give an attacker more attempts. Start with the sample values, observe your log, and change one policy at a time.

Whitelist trusted administrators before enabling the daemon

Add your current administrative address, office or VPN egress addresses, and any other explicitly trusted management hosts through the allowed-hosts mechanism described in the sample configuration. Keep ALLOWED_HOSTS_HOSTNAME_LOOKUP = NO unless you intentionally need hostname-based entries; literal addresses avoid dependence on reverse-DNS results.

After editing, verify that the address is present in the allowed list and that the configuration syntax is valid. Test a second SSH connection from the same trusted network before closing the original session. If you administer through a rotating residential address, document how to reach the VPS console before proceeding; a whitelist entry for yesterday’s address will not protect today’s connection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start DenyHosts and confirm it is working

Start only after the configuration file exists, the trusted addresses are allowed, and the log path is writable by the account that runs the daemon.

  1. Start daemon mode with the project command. The documented form is python /usr/local/bin/denyhosts --config /etc/denyhosts.conf --daemon. Use the actual executable path installed on your VPS if it differs.
  2. Use the distribution control script when provided. It may start, stop, or restart the daemon and manage its lock file. Read its help output and confirm which configuration it selects.
  3. Check the log. The project commonly uses /var/log/denyhosts. Look for startup confirmation, the configuration path, log-reading activity, and any permission or parsing errors.
  4. Verify the process and lock state. Confirm that daemon mode remains running after the initial command returns and that the configured lock path is created as expected.
  5. Make startup persistent. A distribution-provided systemd unit may exist. The project release history records the addition of a systemd service unit, but the unit name and enablement path are distribution-specific. Discover the installed unit rather than assuming a universal name.

Do not generate repeated failed logins from your own production address to test blocking. Use a disposable test host or inspect real log events and then remove the test block through the documented recovery process.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Understand what the thresholds count

DenyHosts distinguishes several classes of SSH failures. Invalid-account attempts use DENY_THRESHOLD_INVALID; failures for a valid account use DENY_THRESHOLD_VALID; root-targeted attempts use DENY_THRESHOLD_ROOT; and restricted users use DENY_THRESHOLD_RESTRICTED. A host can therefore be denied after different numbers of failures depending on the account targeted.

This distinction matters on an internet-facing VPS. Automated scans commonly try nonexistent names, while a targeted attack may repeatedly test a known account. Review the log after deployment to see which class is driving blocks. If a legitimate automation account generates failures, fix its credentials or key configuration instead of simply raising every threshold.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Remove a blocked address safely

If your address is blocked, stop making repeated connection attempts and use the VPS console, rescue environment, or another already-authorized administrator connection. Confirm the address before editing any deny data; removing the wrong entry can reopen access for an attacker or fail to restore your own route.

  1. Identify the active configuration. Check the daemon’s --config argument or control-script variables so you edit the same state and deny files the running process uses.
  2. Confirm the blocked address and timestamp. Inspect the DenyHosts log and blocked-host tracking data.
  3. Add the trusted address to the allowed-hosts mechanism. This prevents an immediate re-block when the daemon sees older failure records.
  4. Use the project’s documented purge or removal procedure. The FAQ and installed manpage describe purge behavior and blocked-host tracking. Do not delete arbitrary files while the daemon is running unless the documentation explicitly permits it.
  5. Restart or reload only as documented. Then test a new SSH connection and watch the log for a successful, non-blocked authentication.

When you need routine expiration rather than emergency recovery, configure PURGE_DENY and invoke denyhosts --purge (or the distribution equivalent). A value such as 1w expires timestamped entries after one week; 5d uses five days. In daemon mode, DAEMON_PURGE = 1h schedules purge checks hourly when purging is enabled.

Set a sensible purge policy

Permanent blocks reduce repeat noise but can retain addresses that later belong to another customer, mobile carrier, or cloud instance. A finite PURGE_DENY period limits that risk. Very short periods allow the same scanner to return quickly; very long periods increase stale-block recovery work.

PURGE_THRESHOLD adds another control by limiting how many times an address can be purged before it remains denied. Use it when recurring offenders should not receive an unlimited sequence of temporary releases. Record your chosen durations in the VPS runbook so another administrator understands why an address disappeared or remained blocked.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common installation failures

The daemon says the configuration file is missing

Confirm that /etc/denyhosts.conf exists, is readable by the daemon account, and is the file selected by --config or DENYHOSTS_CFG. A source install requires you to copy the sample configuration; installation alone does not create it.

No blocks appear even though SSH failures are visible

Check that DenyHosts is reading the same SSH log that records the failures, that the log path and permissions are correct, and that BLOCK_SERVICE is set to sshd rather than an unintended service. Confirm the process is still running and inspect the DenyHosts log for parser or regular-expression errors.

Your administrator address was denied

Use console or alternate access, verify the address currently presented by your network, add it to the allowed-hosts mechanism, and remove the stale deny entry through the documented procedure. If your address changes frequently, use a stable VPN egress or another controlled management path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The control script starts the wrong executable

Review DENYHOSTS_BIN, DENYHOSTS_LOCK, and DENYHOSTS_CFG. These values must point to the executable, lock file, and configuration used by the installation. Check file ownership and execute permissions before retrying.

A systemd command fails because the unit is unknown

Do not assume a fixed unit name. Determine whether your distribution installed a DenyHosts unit, inspect its status and description, and use the unit name supplied by the package. If no unit exists, use the project’s control script or create startup integration that matches your distribution’s policy.

Purge does not remove an entry

Verify that the entry has timestamp information eligible for expiration, that PURGE_DENY is set, and that you invoked the purge option against the active configuration. PURGE_THRESHOLD can intentionally keep repeatedly purged addresses denied.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Optional integrations and advanced settings

The configuration supports optional PF-table and iptables-related integration, plugin hooks, custom regular expressions for failed entries, email reporting, and synchronization settings. Enable these only after the basic SSH-only setup is stable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Firewall integration changes the enforcement layer from host-access files to packet filtering and may require a different recovery procedure. Custom regular expressions can improve coverage for a distribution-specific SSH log format, but an overly broad expression can count unrelated events and create false positives. Email reporting needs a functioning local mail path and should be tested without sending sensitive log contents unnecessarily.

Synchronization features can share deny information between installations. Release notes describe synchronization-server support and invalid-account detection, but synchronization upload and download are opt-in. Evaluate privacy, data retention, trust in the synchronization service, and operational impact before enabling them.

When DenyHosts is the right layer

DenyHosts is a focused choice when you want a Python daemon that parses SSH authentication failures, applies account-sensitive thresholds, and traditionally enforces decisions through host-access controls. It is easy to reason about when the requirement is “block repeated SSH failures on this VPS.”

Assess alternatives using these concrete axes rather than assuming one tool is universally better:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Log source and parser coverage: whether the defense understands your SSH logging format and authentication methods.
  • Enforcement mechanism: host-access denial versus a firewall or packet-filter rule.
  • Whitelist and recovery controls: how trusted addresses are protected and how quickly an administrator can recover from a false positive.
  • Threshold and purge behavior: whether account classes, expiration, and repeat-offender handling match your policy.
  • Service breadth: whether you need SSH only or protection for additional network services.
  • Package and maintenance availability: whether your Linux distribution supplies a maintained package and startup integration.

There is no authoritative performance benchmark in the supplied material that establishes a current speed or blocking-rate advantage over other SSH defenses. Choose based on control, compatibility, recovery, and maintenance requirements that you can verify on your VPS.

Operational checklist

  • Install the package or run the source installer with administrative privileges.
  • Ensure the ipaddr Python module is available.
  • Create /etc/denyhosts.conf from the release’s sample configuration.
  • Set BLOCK_SERVICE = sshd for an SSH-only first deployment.
  • Review the invalid, valid, root, and restricted-user thresholds.
  • Whitelist every trusted administrator address before daemon startup.
  • Confirm the log path and permissions.
  • Start with python /usr/local/bin/denyhosts --config /etc/denyhosts.conf --daemon or the distribution control script.
  • Inspect the DenyHosts log, commonly /var/log/denyhosts.
  • Configure PURGE_DENY and, if desired, DAEMON_PURGE and PURGE_THRESHOLD.
  • Document console access and the exact recovery procedure for a false positive.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.