docs: reorganize and improve documentation

- Add SSH key management warnings and instructions
- Reorganize features and usage sections
- Update examples with consistent usernames
- Add post-installation steps
- Improve formatting and readability

chore(dockerfile): cleanup dockerfile formatting

- Remove extra newlines
- Consolidate package installation commands
- Update test command examples
This commit is contained in:
Pratik Tripathy
2024-12-21 17:04:05 +05:30
parent e58d7058d4
commit 22d6c03047
2 changed files with 161 additions and 483 deletions

View File

@@ -1,26 +1,12 @@
# Fail2ban failed
# FROM debian:12-slim
# UFW failed
FROM debian:12-slim
# FROM debian:11-slim
# All good
FROM ubuntu:24.10
# All good
# FROM ubuntu:24.10
# FROM ubuntu:24.04
# All good
# FROM ubuntu:22.04
# Fail2ban failed
# FROM ubuntu:20.04
# User creation failed, Fail2ban failed
# FROM fedora:41
# User creation failed, Fail2ban failed
# FROM fedora:40
# RUN dnf update -y && dnf install -y sudo openssh-server && dnf clean all && systemctl enable sshd
RUN apt-get update && apt-get install -y sudo openssh-server && rm -rf /var/lib/apt/lists/* && service ssh start
@@ -29,5 +15,21 @@ WORKDIR /script
COPY init-linux-harden.sh .
RUN chmod +x init-linux-harden.sh
# Default command to run the script
CMD ["./init-linux-harden.sh", "-u", "test"]
# Test commands - uncomment one at a time to test different scenarios
# Basic hardening (no user creation)
CMD ["./init-linux-harden.sh"]
# Create new user
#CMD ["./init-linux-harden.sh", "-u", "testuser"]
# Create user and reset root password
#CMD ["./init-linux-harden.sh", "-u", "testuser", "-r"]
# Show credentials in console
#CMD ["./init-linux-harden.sh", "-u", "testuser", "-s"]
# Show credentials and reset root password
#CMD ["./init-linux-harden.sh", "-u", "testuser", "-r", "-s"]
# Show help
#CMD ["./init-linux-harden.sh", "-h"]