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.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:- Login succeeds (appears normal to the attacker)
- PAM triggers a pre-configured script
- The script executes your defined actions (data wipe, alerts, etc.)
- 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
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.