Janna Theme License is not validated, go to the theme options page to validate the license, you need a single license for each domain name.

How to Remove Password from PDF File in Linux

Portable Document Format (PDF) files are the backbone of modern document distribution. With them, you can: Format any document Easily and expect it to be readable on different devices. Here's how to remove a password from a PDF file in Linux.

remove-password-pdf-linux-featured-800x400.jpg How to remove password from PDF file in Linux
The PDF standard also includes the ability to secure your documents with simple password-based encryption. However, this approach requires you to keep track of each password for each PDF file you encrypt. This can be a problem if you want to keep an archive of PDF files for project or bookkeeping purposes.

This tutorial shows you how to remove the password from an encrypted PDF file on Linux. Additionally, we also show you how to recover the password for an encrypted PDF file.

Tip: Looking to add your signature to a PDF on the go? We have the solutions.Sign a PDF file on your Android phone.

Remove password from encrypted PDF file

One of the easiest ways to remove the password from an encrypted PDF document is to "reprint" a copy of it using your system's document viewer. By default, the encryption algorithm that protects a PDF only operates when the data is at rest.

This means that once you open the document, you can easily create an unencrypted duplicate copy using the option Print to PDF Viewer specific.

  1. Open PDF file Encrypted using PDF Reader Your.
  2. The PDF viewer will ask you for a password for your document. Enter your password to open the document.
    remove-pdf-password-linux-05-enter-password-encrypted.png How to remove password from PDF file in Linux
  3. go to the PDF reader list.
    remove-pdf-password-linux-06-open-encrypted-pdf.png How to remove password from PDF file in Linux
  4. Click on Printer button (or print option).
    remove-pdf-password-linux-07-click-printer-button.png How to remove password from PDF file in Linux
  5. Select an option Print to file In the main window portion of the Print menu.
    remove-pdf-password-linux-08-print-to-file-option.png How to remove password from PDF file in Linux
  6. Click the radio button. "PDF" Next to the text box "file".
    remove-pdf-password-linux-09-click-pdf-format.png How to remove password from PDF file in Linux
  7. Click the button "print" To save your PDF document without encryption.
    How to remove password from PDF file in Linux
Also read:  Run Adobe Photoshop on Linux using Wine

Remove PDF password using command line

It's also possible to remove an encrypted PDF password directly from the command line. This can be useful if you want to create a script and automate the removal process.

To do this, get qpdf. This is a simple editing tool that can convert and edit the internal properties of a PDF file. You can install qpdf on Ubuntu by running the following command:

sudo apt install qpdf

How to remove password from PDF file in Linux

On the device, navigate to the directory of the encrypted PDF file and run the following command:

qpdf --password=maketecheasier --progress --decrypt ./encrypted.pdf ./output.pdf

How to remove password from PDF file in Linux

You can too Create a script Simple to automate decryption of an entire directory:

mkdir ./output for i in *.pdf; do qpdf --password=maketecheasier --progress --decrypt "${i}" ./output/"${i}"; done. done

How to remove password from PDF file in Linux Good to know: Once you remove the password, you can easily Merge multiple PDF documents into one document.

Enforce PDF password using pdfcrack

While the above methods will work for PDF files for which you know the password, there are cases where this isn't the case. This can be a problem if you're dealing with an old PDF archive where you've lost the password.

Also read:  How to find resource-hungry processes in Linux command line

How to remove a password from a PDF file in Linux

One way to solve this problem is to install and use the pdfcrack utility. This is a simple program that "cracks" a PDF document's encryption by repeatedly guessing its password, either from a dictionary file or random text.

You can install pdfcrack in Ubuntu by running the following command:

sudo apt install pdfcrack

How to Remove Password from PDF File in Linux

Navigate to the directory containing the encrypted PDF file and run the following command:

pdfcrack -f ./encrypted.pdf

It's important to note that this process can take a long time to complete. For example, a long password containing a combination of symbols and letters can take up to an hour to crack.

remove-pdf-password-linux-16-basic-brute-force-attempt.png How to remove password from PDF file in Linux

You can mitigate this problem by providing a dictionary file to pdfcrack. This is a plain text file containing common passwords you might use in your documents.

You can run the following command to use a dictionary file with pdfcrack:

pdfcrack -f ./encrypted.pdf --wordlist=/home/$USER/Documents/passwords.txt

remove-pdf-password-linux-17-wordlist-brute-force-attempt.png How to Remove Password from PDF File in Linux

Finally, you can restrict certain parameters that pdfcrack uses during brute force cracking. This is useful if you have a vague idea of the length and type of your PDF password.

For example, the following command will tell pdfcrack to guess passwords that contain the characters “sqweartkcyuihop” and are either 12 or 14 characters long.

pdfcrack -f ./encrypted.pdf --charset="sqmweartkcyuihop" --minpw=12 --maxpw=14

How to remove password from PDF file in Linux

Frequently Asked Questions

Q1: Is it possible to copy the encryption of a PDF file to another file?
The answer: Yes. With qpdf, you can "export" encryption settings from one PDF file to another. This is useful if you want to create a script that automatically encrypts a PDF directory using the same password.

Also read:  How to add a user to a group on Linux step by step

You can do this by running the following: qpdf ./new.pdf –copy-encryption-file=./encrypted.pdf –encryption-file-password=mysuperpassword ./output.pdf.

Q2: What are the disadvantages of using the “Print to File” function?
The answer: One of the biggest downsides of using this function is that it will remove any editable fields and plain text within the PDF file. The encrypted PDF will lose all text boxes within it, and you won't be able to copy text from it.

Q3: I accidentally aborted pdfcrack. Is it possible to resume from where I left off?
The answer: By default, pdfcrack always creates a "state" when it accidentally exits. This is a file containing the program's last password attempt and its progress through the current process. To resume your last session, run the following: pdfcrack -f ./encrypted.pdf –loadstate=./savestate.sav.

Go to top button