Today I happen to share a password protected PDF file to one of my friend. I knew the password of that PDF file, but I didn’t want to disclose it. Instead, I just wanted to remove the password and send the file to him. I started to looking for some easy ways to remove the password protection from the pdf files on Internet. After a quick google search, I came up with four methods to remove password from a PDF file in Linux. The funny thing is I had already done it few years ago and I almost forgot it. If you’re wondering how to remove password from a PDF file in Linux, read on! It is not that difficult.
### Remove Password From A PDF File in Linux
**Method 1 – Using Qpdf**
The **Qpdf** is a PDF transformation software which is used to encrypt and decrypt PDF files, convert PDF files to another equivalent pdf files. Qpdf is available in the default repositories of most Linux distributions, so you can install it using the default package manager.
For example, Qpdf can be installed on Arch Linux and its variants using [**pacman**][1] as shown below.
```
$ sudo pacman -S qpdf
```
On Debian, Ubuntu, Linux Mint:
```
$ sudo apt-get install qpdf
```
Now let us remove the password from a pdf file using qpdf.
I have a password-protected PDF file named **“secure.pdf”**. Whenever I open this file, it prompts me to enter the password to display its contents.
![][3]
I know the password of the above pdf file. However, I don’t want to share the password with anyone. So what I am going to do is to simply remove the password of the PDF file using Qpdf utility with following command.
Replace ‘123456’ with your correct password. This command decrypts the “secure.pdf” file and create an equivalent non-password protected file named “output.pdf”.
**Also read:**
**Method 3 – Using Poppler**
**Poppler** is a PDF rendering library based on the xpdf-3.0 code base. It contains the following set of command line utilities for manipulating PDF documents.
* **pdfdetach** – lists or extracts embedded files.
* **pdffonts** – font analyzer.
* **pdfimages** – image extractor.
* **pdfinfo** – document information.
* **pdfseparate** – page extraction tool.
* **pdfsig** – verifies digital signatures.
* **pdftocairo** – PDF to PNG/JPEG/PDF/PS/EPS/SVG converter using Cairo.
* **pdftohtml** – PDF to HTML converter.
* **pdftoppm** – PDF to PPM/PNG/JPEG image converter.
* **pdftops** – PDF to PostScript (PS) converter.
* **pdftotext** – text extraction.
* **pdfunite** – document merging tool.
For the purpose of this guide, we only use the “pdftops” utility.
To install Poppler on Arch Linux based distributions, run:
```
$ sudo pacman -Spoppler
```
On Debian, Ubuntu, Linux Mint:
```
$ sudo apt-get install poppler-utils
```
On RHEL, CentOS, Fedora:
```
$ sudo yum install poppler-utils
```
Once Poppler installed, run the following command to decrypt the password protected pdf file and create a new equivalent file named output.pdf.
```
$ pdftops -upw 123456 secure.pdf output.pdf
```
Again, replace ‘123456’ with your pdf password.
As you might noticed in all above methods, we just converted the password protected pdf file named “secure.pdf” to another equivalent pdf file named “output.pdf”. Technically speaking, we really didn’t remove the password from the source file, instead we decrypted it and saved it as another equivalent pdf file without password protection.
**Method 4 – Print to a file
**
This is the easiest method in all of the above methods. You can use your existing PDF viewer such as Atril document viewer, Evince etc., and print the password protected pdf file to another file.
Open the password protected file in your PDF viewer application. Go to **File - > Print**. And save the pdf file in any location of your choice.
![][9]
And, that’s all. Hope this was useful. Do you know/use any other methods to remove the password protection from PDF files? Let us know in the comment section below.