Blog
Wild & Free Tools

Unlock a PDF on Linux Using the Command Line

Last updated: March 2026 5 min read
Quick Answer

Table of Contents

  1. Install qpdf on Linux
  2. Remove Owner Restrictions
  3. Remove an Open Password
  4. Check if a PDF Is Encrypted
  5. Frequently Asked Questions

Linux users have a clean, scriptable solution for unlocking PDFs: qpdf. It's in every major distro's package repository, it's open source, and it handles both owner-restricted PDFs (no password needed) and password-protected PDFs where you know the password.

If you prefer a browser-based approach with no terminal work, the Puma PDF Unlocker runs entirely in your browser on Linux just as it does on any other OS.

Installing qpdf on Linux

qpdf is available in all major distro repositories:

# Ubuntu / Debian
sudo apt install qpdf

# Fedora / RHEL / CentOS
sudo dnf install qpdf

# Arch Linux
sudo pacman -S qpdf

# openSUSE
sudo zypper install qpdf

Verify the install:

qpdf --version

Remove Owner Restrictions (No Password Required)

Owner restrictions prevent printing, copying text, or editing. qpdf removes them without needing any password:

qpdf --decrypt input.pdf output.pdf

The output file has all restrictions cleared. The original is unchanged. If the file only has owner restrictions (not an open password), this command is all you need.

To process all PDFs in a directory:

mkdir -p unlocked
for f in *.pdf; do
  qpdf --decrypt "$f" "unlocked/$f"
done
Sell Custom Apparel — We Handle Printing & Free Shipping

Remove an Open Password (When You Know It)

If the PDF requires a password to open, provide it with the --password flag:

qpdf --password=yourpassword --decrypt input.pdf output.pdf

If the password contains special characters like spaces or @, wrap it in quotes:

qpdf --password="p@ss word" --decrypt input.pdf output.pdf

qpdf cannot recover or crack an unknown password. If you don't know the open password, a brute-force tool would be needed — but for most legitimate use cases (bank statements, work documents), the password is known or follows a predictable pattern.

Check Whether a PDF Is Password-Protected

Before trying to unlock, you can inspect the PDF's encryption status:

qpdf --show-encryption input.pdf

This shows whether the file uses an open password, owner restrictions, or both — and the encryption level (40-bit RC4, 128-bit AES, 256-bit AES).

You can also check with pdfinfo (from the poppler-utils package):

sudo apt install poppler-utils
pdfinfo input.pdf | grep Encrypted

If it prints Encrypted: yes, the file has some form of protection that qpdf can remove (as long as you have the open password if one is set).

No Terminal? Use the Browser Tool Instead

The Puma PDF Unlocker works on Linux in any browser. No install, no commands — just drop your PDF and click Unlock.

Unlock PDF Free

Frequently Asked Questions

Can I use pdftk instead of qpdf on Linux?

pdftk can also remove owner restrictions: pdftk input.pdf input_pw YOURPASSWORD output output.pdf allow AllFeatures. However, pdftk development has been less active than qpdf, and qpdf is more widely available in modern distro repos. Both work for basic unlocking.

What if qpdf gives a wrong password error?

The file has an open password that does not match what you provided. Double-check the password — capitalization, special characters, and leading/trailing spaces all matter. If you're trying to unlock without a password, the file likely requires one and qpdf cannot bypass it.

Can I unlock PDFs in a shell script for automation?

Yes. qpdf is designed for scripting. It exits 0 on success and non-zero on error, so you can use it in conditional logic. Combine it with find to process nested directories: find . -name "*.pdf" -exec qpdf --decrypt {} unlocked/{} \;

Does qpdf work on encrypted PDFs with 256-bit AES encryption?

Yes. qpdf handles 40-bit RC4, 128-bit RC4, 128-bit AES, and 256-bit AES encryption. As long as you supply the correct password (or the file only has owner restrictions), the encryption level does not matter for decryption.

Michael Turner
Michael Turner OCR & Document Scanning Expert

Michael spent five years managing document-digitization workflows for a regional healthcare network.

More articles by Michael →
Launch Your Own Clothing Brand — No Inventory, No Risk