Skip to content

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

Merged
captainzero93 merged 2 commits intocaptainzero93:mainfrom
artschekoff:main
Apr 23, 2026
Merged

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

Conversation

@artschekoff
Copy link
Copy Markdown
Contributor

@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
Contributor Author

related to issue #14

@captainzero93 captainzero93 merged commit 698e61f into captainzero93:main Apr 23, 2026
@captainzero93
Copy link
Copy Markdown
Owner

Thank you

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.

2 participants