Wren Howell
June 2, 2025

Looking at Linux Persistence Mechanisms

Posted on June 2, 2025  •  3 minutes  • 464 words

Recently, I had a to write a playbook on common persistent mechanisms. Even though there are lot of resources for this, I did not feel like recreating common persistence mechanisms playbooks on Linux again. This is not a comprehensive list of all the places that persistence can occur on Linux, but it is a start and order will be from most common locations to lesser known places. This page is going to be a work in progress as I add more persistence locations in the future.

What is persistence?

Persistence is “the characteristic of a state that outlives the process that created it.” Breaking down the language in a more straightforward way, persistence is the ability of software, configurations, or data to remain even after the system is restarted or shut down. Persistence is essential for computers to run smoothly, but threat actors use persistence to maintain unauthorized access to a machine.

What are some common Linux Persistence locations?

There are also many places where persistence can occur in Linux as well. Some of the persistence mechanisms are similar to Windows, like cron jobs, but some are different.

Some common Linux Persistence locations are listed below:

What is Cron job and where is it located?

For user wide cron jobs:

For system defined cron jobs:

What is SSH and why is it used for persistence?

SSH is a network protocol that is used for computers to connect with each other. SSH is one of the main ways that Linux computers network. One of the critical parts of the SSH is the authorized_keys file. This is a file that list of public keys that are allowed to log in to a given user account. Looking at this file is key to seeing if there is a unauthorized user trying to get access to account.

The authorized keys in located in two directories

/home/<username>/.ssh/authorized_keys
/root/.ssh/authorized_keys

To show when the authorized keys were added

stat ~/.ssh/authorized_keys

What are start up scripts and where are they located?

Start up scripts are like autorun scripts in Windows and these programs run automatically when the system boot or when a user logs in. There are many scripts that run on the user and system level.

User Level

Follow me

My people say I don't bite