Skip to content

AI prompts every sysadmin should keep on hand

This page may contain affiliate links.

Let's be honest: being a sysadmin in 2025 means you're less 'keeper of the servers' and more 'professional context-switcher'. Between patching, monitoring, and explaining to the finance director why the printer is on fire, you don't have time to write elegant Ansible playbooks from scratch. That's where AI comes in. Not as a replacement for your brain, but as a very fast, very patient junior admin who never sleeps. The trick is knowing how to ask. Here are the prompts I keep in a text file, ready to fire at ChatGPT, Claude, or whatever your workplace lets you use.

1. The log triage prompt

You've got a 2GB log file and an angry ticket. Don't paste the whole thing — that's a recipe for hallucinated answers. Instead, give the AI context and ask it to be a detective, not a fortune teller.

Prompt:
'You are a senior Linux sysadmin. I have a log file from [service] on [OS version]. Here are the last 200 lines around the error, plus the relevant config. Identify the root cause, rank the top 3 likely issues, and for each give me a command to verify it. Do not suggest restarting the service unless it's genuinely the fix. Format as a numbered list with bold headers.'

Why this works: you're constraining the scope, forcing verification steps, and banning the lazy 'have you tried turning it off' answer. I use this daily for nginx, postfix, and systemd journals. It's cut my mean-time-to-acknowledgement from an hour to about ten minutes.

2. The bash one-liner generator

We all know the feeling: you need to find all files over 500MB modified in the last week, but you can't remember if it's find with -mtime or -newermt. Instead of Googling and getting a 2014 StackOverflow answer, use this prompt.

Prompt:
'Write a bash one-liner that [task]. It must be safe to run on a production server — no destructive commands unless I explicitly ask. Include an explanation of each flag, and also give me a dry-run version that only prints what it would do. Target environment: Ubuntu 22.04 with GNU coreutils.'

That last bit is gold. AI sometimes gives you BSD-flavoured commands that break on Linux. By specifying GNU coreutils, you avoid the find -exec vs find -execdir trap. For example, I recently needed to archive old logs. The prompt gave me a tar command with --remove-files and a dry-run that listed everything first. Saved me from a very awkward Monday.

3. The 'explain this config' prompt

You inherit a server with a 400-line nginx.conf that's been touched by six people, three of whom have left. You need to understand it before you touch it. This is where AI shines — it's patient and never rolls its eyes.

Prompt:
'Act as a senior infrastructure consultant. Here is my [config file type] for [service]. Explain what each block does in plain English, flag anything that looks insecure, outdated, or redundant, and suggest one improvement you'd make if I gave you permission. Be specific about potential failure points. Do not rewrite the file unless I ask.'

Paste the config. I've used this on nginx, postgresql.conf, and even a gnarly docker-compose.yml. The AI will often spot things you've missed — like a missing client_max_body_size or a deprecated directive that's only working because of a compatibility shim. It's like having a second pair of eyes that never gets tired.

4. The security audit starter

You don't need a £500 pentest report to catch the low-hanging fruit. But you do need to ask the right questions. This prompt turns your AI into a checklist-driven auditor.

Prompt:
'I run a small UK-based business with [number] servers running [OS and services]. Perform a high-level security review based on best practice. For each of these areas — SSH config, firewall rules, user accounts, open ports, and update policy — give me a list of concrete commands to run to check for issues. Prioritise by risk: Critical, High, Medium. Do not run anything yourself; just give me the commands.'

Then actually run them. The output will be a checklist you can work through. It won't replace a proper audit, but it'll stop you leaving port 3306 open to the world. I pair this with a quick nmap scan of my external IP (from a separate machine, obviously) and feed the results back into the AI for interpretation. That's a genuinely powerful combo.

5. The documentation generator

Nobody likes writing runbooks. But future-you will love present-you for it. AI can draft a decent first pass in minutes, and you just correct the details.

Prompt:
'Create a runbook for [service/process]. Include: purpose, architecture diagram description (text only), common failure modes, step-by-step recovery procedures, rollback plan, and a section for post-incident notes. Use UK English, keep it under 800 words, and use bullet points for procedures. Here is the current setup: [paste config or describe].'

I used this to document our backup restore process. The AI produced a clear, numbered guide that even our junior developer could follow. It wasn't perfect — it missed the bit about our offsite tape storage — but it saved me an afternoon of typing. The key is to treat the output as a draft, not gospel. You're the expert; AI is just your scribe.

If you find yourself writing these prompts over and over, there's a shortcut. I've put together a Home Lab & Automation Pack — a collection of ready-made, battle-tested AI prompts for scripting, troubleshooting, and documenting your home lab or small business environment. It's from £9, and it's basically the done-for-you version of everything I've shown you above, plus a few extras like network mapping and backup verification prompts. Worth a look if you'd rather skip the trial and error.

Putting it all together

Here's my workflow: I keep a notes file with these five prompts (plus my own variations). When something breaks, I copy the relevant prompt, paste the log or config, and let the AI do the grunt work. Then I verify everything it suggests before running it on a live system. That last step is non-negotiable — AI is a tool, not a supervisor.

One more tip: always tell the AI your context. 'UK small business, two admins, budget-conscious' will get you different answers than 'enterprise, 500 nodes, compliance-heavy'. The more specific you are, the better the output. And if the first answer is rubbish, ask it to try again with a different approach. It doesn't get offended.

So there you have it: five prompts that'll save you hours each week. Copy them, tweak them, make them your own. And if you've got a prompt that's saved your bacon, I'd love to hear it — drop it in the comments below. Now go fix that thing before someone notices it's down.

Written by

Richard Tucker

View all posts →