Unlock a PDF on Linux Using the Command Line
- On Linux, qpdf is the standard tool for removing PDF passwords and owner restrictions from the command line.
- Install with apt, dnf, or pacman — then a single command unlocks the file.
- For a browser-based option without any install, the Puma PDF Unlocker works on Linux just like any other OS.
Table of Contents
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 FreeFrequently 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.

