If you’re like most people, you probably use PDF files to store important documents and data. But if you’re a security researcher or hacker, you may be interested in knowing how to remove passwords from PDF files. There are a few different ways to remove passwords from PDF files, but the most common is to use a password manager such as LastPass or KeePass. But if you don’t have a password manager, there are other ways to remove passwords from PDF files. The first way is to use the command line tool “passwd”. This tool can help you find and remove passwords from individual pages of a PDF file. To start the tool, type “passwd” at the command line. The next way to remove passwords is to use the “gpg –remove-password” command. This command can help you Remove all your current passwords from a PDF file. To start the tool, type “gpg” at the command line. The last way to remove passwords is to use the “pdfutil –remove-password” command. Thiscommand can help you Remove all your current password protection features from a PDF file. To start the tool, type “pdfutil” at the command line.


You’ve protected a PDF file containing sensitive information with a long, secure password so only the intended party can open it. However, you don’t want to enter that password every time you access the document, so you want to remove the password from your copy.

We will show you four ways in Linux to remove a password from a PDF file when you know the password.

NOTE: When we say to type something in this article and there are quotes around the text, DO NOT type the quotes, unless we specify otherwise.

Using the PDF Toolkit (pdftk)

The PDF Toolkit is a handy command line tool for manipulating PDF files. To install pdftk, press Ctrl + Alt + T to open a Terminal window. Type the following command at the prompt and press Enter.

Type the password for your user account when prompted and press Enter.

The installation process begins with an analysis of your system and lists how many packages will be installed and how much space they will use. When asked if you want to continue, type a “y” and press Enter.

When the installation is finished type the following command at the prompt, replacing the relevant parts as indicated below.

The breakdown of the command is as follows:

Press Enter to execute the command.

The unprotected PDF file is generated and saved to the location you specified in the command.

Using QPDF

QPDF is a command-line program for Linux that converts from one PDF file to another equivalent PDF file while preserving the content of the file. The tool allows you to encrypt and decrypt, web-optimize, and split and merge PDF files.

If you’re using the latest version of Ubuntu (14.04 as of the writing of this article), QPDF is most likely installed. If it’s not installed, press Ctrl + Alt + T to open a Terminal window and type the following command at the prompt.

Type your account password when prompted and press Enter.

Once QPDF is installed, type the following command at the prompt and press Enter.

The breakdown of the command is as follows:

Using xpdf-utils

Xpdf-utils is a package of PDF utilities that includes a PDF to PostScript converter (pdftops), a PDF document information extractor (pdfinfo), a PDF image extractor (pdfimages), a PDF to text converter (pdftotext), and a PDF font analyzer (pdffonts). For more information about each tool, type the command (in parentheses for each tool listed) followed by “–help” (two dashes before help).

To remove a password from a PDF file, we will use the PDF to PostScript (pdftops) tool and the Ghostscript PostScript-to-PDF Converter to convert the postscript file back to an unprotected PDF file.

The xpdf-utils package may already be installed if you’re using the latest version of Ubuntu. If not, type the following command at the prompt and press Enter to install the package.

Type your account password when prompted and press Enter.

Once xpdf-utils is installed, you’re ready to convert your password-protected PDF file to a postscript file. Type the following command at the prompt and press Enter.

The breakdown of the command is as follows:

The postscript file is generated and placed in the folder you specified in the command.

Before converting the postscript file back to an unprotected PDF file, you must install the Ghostscript Postscript-to-PDF Converter (ps2pdf). To do this, type the following command at the prompt and press Enter.

Type your account password at the prompt and press Enter.

The installation process begins with an analysis of your system and lists how many packages will be installed and how much space they will use. When asked if you want to continue, type a “y” and press Enter.

Once ps2pdf is installed, type the following command at the prompt and press Enter.

The breakdown of the command is as follows:

A new, unprotected PDF file is generated and placed in the folder you specified in the command.

Using Evince

Evince is the default PDF file viewer that comes with Ubuntu. You can use it to remove a password from a PDF file as long as you know the password. It’s a graphical tool, but we will run it from the command line. To run Evince, type the following command at the prompt and press Enter.

Replace the full path and filename for your PDF file.

NOTE: You may see the following error message, but the file will open anyway.

Evince displays a dialog box asking for the user password to open the PDF file. Enter the password in the edit box and select how long you want Evince to remember the password. Click “Unlock Document”.

When the PDF file opens, select “Print” from the “File” menu.

On the “Print” dialog box, select “Print to File”. If you want to change the filename or the location where it’s saved, click the button next to “File” showing the path and filename.

On the “Select a filename” dialog box, navigate to the location where you want to save the unprotected PDF file and enter a name for the file in the Name field. Click “Select”.

The new path and filename displays on the “File” button. Accept the default settings for the other options and click “Print”.

The unprotected PDF file is saved to the location you chose.

Double-click on the file to open it again in Evince. Notice that you are not asked for the password.

Remember, to remove a password from a PDF file using these tools you must know the password.