# sftp-fail2ban

sftp-fail2ban is a Debian-based SFTP server container that runs OpenSSH with Fail2ban to harden secure file transfer against brute-force attacks for homelab users. It is open source and self-hosted, installable on Docker Hub and Unraid.

Canonical page: https://ourlocalhost.com/app/2245/sftp-fail2ban

## Description

SFTP Fail2ban is a Debian-based SFTP server container that runs OpenSSH with Fail2ban to harden secure file transfer against brute-force attacks for homelab users.

## Platform availability

Available on 1 of 10 platforms: Unraid.

## Health score

45/100 (Fair), based on 3 of 4 factors.
- Maintained: 72 (last commit 21 days ago)
- Popular: 10 (2 GitHub stars)
- Easy to install: 35 (1 install platform, install notes, Docker image)

## Links

- Docker Hub: https://hub.docker.com/r/bmmbmm01/sftp2
- GitHub: https://github.com/bmartino1/sftp2
- Unraid: https://ca.unraid.net/apps/sftp-fail2ban-0mjwuaa0h25zkm?q=sftp-fail2ban

## Common questions

### How does Fail2ban protect an SSH/SFTP endpoint from brute-force attempts?

Fail2ban scans log files such as auth.log and bans IP addresses that cause too many failed login attempts. It updates firewall rules to reject new connections from those IPs for a configurable period.

### Which port do SFTP clients normally need to use?

Most SFTP servers use port 22. If the server is configured for a different port, clients must use that exact port.

### Where should SFTP connection details be stored?

Store the host, username, password, and port in a .env file or environment rather than in code. This keeps credentials outside the main program and reduces accidental sharing.

### What security issue is linked to the SFTP project discontinuation in the support page?

The Unraid support page notes the SFTP project was discontinued due to an OpenSSH CVE.

---
Source: Our Local Host (https://ourlocalhost.com/app/2245/sftp-fail2ban), the self-hosted and open-source app directory.
