Skip to content

Debian/Ubuntu SSH hardening: sftp path, ssh/sshd units, UFW port#16

Open
artschekoff wants to merge 2 commits intocaptainzero93:mainfrom
artschekoff:main
Open

Debian/Ubuntu SSH hardening: sftp path, ssh/sshd units, UFW port#16
artschekoff wants to merge 2 commits intocaptainzero93:mainfrom
artschekoff:main

Conversation

@artschekoff
Copy link
Copy Markdown

@artschekoff artschekoff commented Apr 4, 2026

Summary

  • SSH: Resolve sftp-server path dynamically (default Debian/Ubuntu location + fallbacks) and wire Subsystem sftp to that path; restart ssh or sshd after changes.
  • UFW: When opening SSH, detect active ssh or sshd (Ubuntu vs others) and apply rate limiting on the configured SSH_PORT.

Merged with current upstream fortress_improved.sh (v5.1 template, SSH_ALLOWED_USERS, etc.) so behavior stays compatible with the latest script.

Motivation

Hardcoded /usr/lib/openssh/sftp-server, sshd-only service checks, and ufw limit ssh miss common Debian/Ubuntu setups and non-default SSH ports.

- Resolve sftp-server dynamically with fallbacks instead of a fixed path
- Restart ssh or sshd after config; UFW checks both units for active SSH

Made-with: Cursor
Resolve fortress_improved.sh: combine Debian/Ubuntu sftp-server discovery with
upstream v5.1 SSH template, AllowUsers append, PrintLastLog/TCPKeepAlive/
Compression, sshd -t validation, and UFW rate limit on SSH_PORT with ssh/sshd
unit detection.

Made-with: Cursor
@artschekoff
Copy link
Copy Markdown
Author

related to issue #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant