Skip to main content

Why This Matters

A panic password system adds extra security against physical attacks where someone is forced to reveal their password (assault, robbery, ransom, coercion). With pam-duress, you can configure a secondary “panic” password that:
  • Allows login (so the attacker doesn’t know it’s a panic password)
  • Automatically triggers a protective script when used
  • Can destroy data, lock the system, or alert administrators

Real-World Example Scenario

Imagine a robber breaks into your home and steals your server. They boot it at their location and begin a brute-force attack. They crack what appears to be a weak password for the ‘admin’ user and successfully SSH in. Within 2 minutes, the server becomes extremely busy and freezes. The robber reboots to try again… but all data and the system have been destroyed. What happened? The cracked password was the panic password, which triggered a script that deleted all files, configurations, and system data, then overloaded CPU and RAM to force a reboot. The real data is gone before the attacker realizes what happened.
Use with Extreme CautionA panic password script can be configured to permanently destroy data. Only implement this if:
  • You understand the risks and implications
  • You have complete, tested backups
  • Your security policy requires this level of protection
  • You’ve thoroughly tested in a non-production environment
This is an advanced security measure that can render your system completely inoperable.

How It Works

pam-duress is a PAM module that allows you to configure a secondary password for any user. When someone logs in with the panic password instead of the real password:
  1. Login succeeds (appears normal to the attacker)
  2. PAM triggers a pre-configured script
  3. The script executes your defined actions (data wipe, alerts, etc.)
  4. The user has a normal session (while the script runs in background)

Prerequisites

Required packages:
  • git
  • build-essential
  • libpam0g-dev
  • libssl-dev

Installation Script

The following script automates the installation and configuration of pam-duress:

Manual Installation Steps

If you prefer to install manually:
1

Install dependencies

2

Clone and build pam-duress

3

Create the panic script

Create a directory for your panic script:
Create /root/.duress/PanicScript.sh with your desired actions:
4

Sign and secure the script

5

Configure PAM

Backup the current PAM configuration:
Edit /etc/pam.d/common-auth and configure it for pam-duress:
6

Set the panic password

Run the duress password setup for your user:
Follow the prompts to set your panic password.

Customizing the Panic Script

The panic script can be customized to perform various actions:

Data Destruction

System Lockdown

Alert and Log

Fake Normal Operation

Testing

Test in a Safe EnvironmentBefore deploying this in production:
  1. Set up a test VM or container
  2. Configure a non-destructive panic script first (e.g., just logging)
  3. Test login with both real and panic passwords
  4. Verify the script executes as expected
  5. Only then consider using destructive actions

Safe Test Script

Security Considerations

Backup Everything

Have complete, tested, off-site backups before implementing data destruction

Legal Implications

Check local laws regarding data destruction and obstruction

False Positives

You might accidentally use the panic password - make them distinct

Script Security

Ensure panic scripts are only readable/executable by root

Uninstallation

To remove pam-duress:

References

This feature is for advanced users with specific security requirements. Most users will not need a panic password system.