Λογότυπο Server Security Init

Server Security Init

Κοινότητα
DeerYang
server-security-init

Use when safely initializing or hardening a newly installed or rebuilt Ubuntu/Debian server over SSH, including SSH keys, a non-root sudo user, SSH policy, server timezone, UFW, fail2ban, local SSH config, and lockout-safe verification.

Επισκόπηση

ΕκδότηςDeerYang
Αποθετήριοserver-security-init-skill
Όνομα δεξιότηταςserver-security-init
Αστέρια
41
Forks
1
Συνοδευτικά αρχεία
3
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • 3 συνοδευτικά αρχεία

    Σενάρια, πρότυπα και υλικό αναφοράς που μπορεί να διαβάζει το μοντέλο καθώς εργάζεται. Τα αρχεία είναι μόνο για ανάγνωση και δεν εκτελούνται ποτέ.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε από DeerYang στο GitHub. Διαβάστε το πηγαίο περιεχόμενο πριν εγκαταστήσετε τη δεξιότητα.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Server Security Init στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/DeerYang/server-security-init-skill/tree/main/server-security-init
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Νέα δεξιότητα → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που διαβάζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/DeerYang/server-security-init-skill.git /tmp/server-security-init-skill
mkdir -p .claude/skills
cp -r /tmp/server-security-init-skill/server-security-init .claude/skills/server-security-init
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Server Security Init σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Server Security Init μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Server Security Init δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλα κατά τη συνομιλία

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

Server Security Init

Purpose and Scope

Harden a fresh Ubuntu/Debian server without locking the operator out. Treat SSH, firewall, fail2ban, and service-manager changes as high-risk: inspect first, add and verify a parallel access path, then remove old access paths.

This workflow targets OpenSSH with systemd. UFW and fail2ban are optional. For another distribution, firewall, init system, or SSH implementation, stop before mutation, explain the differences, and obtain agreement on an adapted plan.

Intake

Collect the bootstrap facts before touching the server. Infer values from prior context or local SSH config when safe, but show inferred values and obtain confirmation before high-risk mutations.

ParameterMeaning
root_public_key_installedWhether the selected public key already works for the initial login user
target_hostServer IP, hostname, or existing SSH alias
initial_userCurrent login user, often root
initial_portCurrent SSH port, often 22
admin_userNon-root human administrator account to create or verify
public_key_sourceLocal .pub file, existing authorized key, or pasted public key
local_key_nameLocal key basename, usually derived from the server alias
identity_fileMatching local private-key path used for every access-path gate
ssh_config_aliasLocal SSH alias to create or update
new_ssh_portFinal SSH port
target_timezoneDesired IANA timezone such as UTC or Asia/Shanghai, or keep-current
recovery_accessAvailable provider console, VNC, rescue panel, or other out-of-band recovery path
external_firewall_readyWhether provider/security-group rules permit the temporary and final SSH ports

Collect these choices at the same intake gate:

ParameterDefault
disable_root_logintrue; when false, retain root public-key login rather than enabling root passwords
disable_password_logintrue
enable_ufwtrue
rebuild_ufwfalse; preserve existing rules unless the user explicitly approves rebuilding them
allowed_tcp_portsNo additional ports; new_ssh_port is handled separately
enable_fail2banAsk; do not infer consent
management_ipsRequired only when enabling fail2ban; current and usual admin egress IPs/CIDRs
fail2ban_maxretry3
fail2ban_findtime86400
fail2ban_bantime86400
generate_local_keypairAsk if no usable key exists
local_key_commentServer alias or user-specified comment
local_key_passphraseAsk; do not assume an empty passphrase

Do not infer target_timezone from the operator's computer. Ask which timezone the server should use and validate the exact IANA name on the server.

Input Validation

  • admin_user: require ^[a-z_][a-z0-9_-]{0,31}$; reject root. If it exists, require UID >= 1000, a real home directory, and an interactive shell. Never grant passwordless sudo to a service account.
  • Ports: require numeric TCP ports in 1..65535; prefer 1024..65535 unless the user explicitly chooses a privileged port. Deduplicate allowed_tcp_ports.
  • Public key: resolve to exactly one non-empty valid public-key line and validate it with ssh-keygen -lf through a temporary file. Never print or transmit the private key.
  • target_timezone: require keep-current or an exact entry from timedatectl list-timezones.
  • management_ips: accept only explicit IP addresses or CIDRs recognized by the user. If the current egress cannot be determined confidently, ask before enabling fail2ban.
  • Hostnames, aliases, paths, and other substituted values must not contain newlines. Treat all values as data, never shell fragments.

Safety Invariants

  • Do not disable root login, password login, the old SSH listener, or the old firewall rule until the new admin path succeeds in a separate SSH process.
  • Every access-path gate must use the selected key explicitly with BatchMode=yes, IdentitiesOnly=yes, ConnectTimeout, and -i identity_file; success through an unrelated ssh-agent key is not proof.
  • Keep the original SSH session open. Before changing listeners, confirm recovery_access and provider/security-group rules for new_ssh_port.
  • Back up every changed configuration and record restoration commands. If a stage fails, stop mutations and either restore that checkpoint through the still-working session or use out-of-band recovery.
  • Prefer owned drop-ins. Do not bulk-comment arbitrary SSH directives. If non-stock directives, Match blocks, config-management ownership, or an unexpected effective policy prevents a clean drop-in, stop and propose a targeted migration.
  • Validate SSH syntax and effective policy before restart; after restart, use sshd -T, sshd -T -C, ss -ltnp, and systemd state as server-side truth.
  • Inspect ssh.socket. Socket activation may own a listener independently of sshd_config; never assume changing Port moved the real listener.
  • enable_ufw=false means do not install, reset, enable, or modify UFW. When enabled, preserve existing rules by default. Run ufw --force reset only when rebuild_ufw=true was explicitly confirmed and a restorable backup exists.
  • Configure fail2ban ignoreip before enabling its SSH jail. Do not enable fail2ban without confirmed management IPs/CIDRs.
  • Never overwrite an existing private key, automate a root password by default, or place passwords/private keys in commands, logs, config, or reports.
  • Update only the requested local SSH Host block after backing up the file. Avoid regexes that can consume adjacent blocks.
  • A reboot is a separate disruptive action. Perform it only with explicit authorization and an available recovery path.

Workflow

  1. Intake and key bootstrap

    • Collect and confirm the intake table, including target_timezone.
    • If needed, read references/ubuntu-openssh-ufw-fail2ban.md for local key generation and one-time public-key installation.
    • Stop until the selected key passes the initial public-key login gate.
  2. Read-only preflight and plan

    • Read references/ubuntu-openssh-ufw-fail2ban.md.
    • Confirm Ubuntu/Debian version, current timezone, effective SSH policy, listeners, socket/service state, UFW rules, fail2ban state, existing admin account, and external firewall readiness.
    • Show the intended changes, preserved ports/rules, checkpoints, and recovery path before high-risk mutation.
  3. Add and verify a parallel admin path

    • Set the confirmed timezone if it is not keep-current, then verify it.
    • Create or validate admin_user, install the selected public key, and validate passwordless sudo with visudo and sudo -n.
    • Add new_ssh_port while retaining initial_port. If UFW is enabled, allow both SSH ports plus explicit application ports without deleting unrelated rules.
    • Handle ssh.socket deliberately, restart SSH, verify the actual listener, and prove the new admin path in a separate local SSH process using identity_file explicitly.
  4. Apply and verify the final SSH/firewall state

    • Apply the requested root/password policy through an owned drop-in; abort on unexpected effective values instead of rewriting unrelated files.
    • Restart SSH and re-prove the new admin path before removing the old listener or firewall rule.
    • If UFW is enabled, retain new_ssh_port and every confirmed allowed_tcp_port; remove the old SSH rule only when that port is not intentionally retained.
    • Verify root-key refusal when root login is disabled. Prove password policy with sshd -T/sshd -T -C; a client command using BatchMode=yes is not evidence that password authentication is disabled.
  5. Optional fail2ban

    • Run only when enable_fail2ban=true.
    • Detect whether the chosen backend and ban action fit the host, configure ignoreip first, then enable and verify the jail. Unban and stop if a management IP is present in the ban list.
  6. Local SSH config and final verification

    • Back up and update only ssh_config_alias; verify the resolved settings with ssh -G and reconnect through the alias.
    • Read and follow references/verification-checklist.md, including timezone, firewall conditionals, checkpoint locations, and service enablement.
    • Report meaningful redacted outputs. Do not echo inline public-key material, secrets, or unnecessary personal infrastructure details.
    • Offer an explicitly authorized reboot-and-reconnect test for persistence; do not reboot automatically.

References

  • references/ubuntu-openssh-ufw-fail2ban.md: read for Ubuntu/Debian command patterns, UFW branches, socket handling, fail2ban, and recovery checkpoints.
  • references/verification-checklist.md: read for initial gates and final observable assertions.

Συνοδευτικά αρχεία

Το μοντέλο τα διαβάζει όποτε χρειάζεται, όσο η δεξιότητα είναι φορτωμένη. Διατίθενται ως αρχεία για ανάγνωση και δεν εκτελούνται ποτέ.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Server Security Init;

Use when safely initializing or hardening a newly installed or rebuilt Ubuntu/Debian server over SSH, including SSH keys, a non-root sudo user, SSH policy, server timezone, UFW, fail2ban, local SSH config, and lockout-safe verification.

Γιατί να χρησιμοποιήσετε τη δεξιότητα Server Security Init στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Server Security Init είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη Server Security Init στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε το https://github.com/DeerYang/server-security-init-skill/tree/main/server-security-init. Το TypingMind διαβάζει το αρχείο SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Server Security Init;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη Server Security Init;

Με όσα θέλετε. Εφόσον ένα μοντέλο υποστηρίζει δεξιότητες, μπορείτε να χρησιμοποιήσετε τη Server Security Init με αυτό — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama και άλλα — όλα στο TypingMind με τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Server Security Init;

Ναι. Δημοσιεύεται στο GitHub από τον χρήστη DeerYang με την άδεια χρήσης MIT. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇