HowTo: Linux Remove a PDF File Password Using Command Line Options

You can use the qpdf command-line tool to remove a password from a PDF file in Linux. Here’s how to do it:

  1. Install the qpdf package if it’s not already installed on your system. You can do this using the package manager for your Linux distribution. For example, in Ubuntu or Debian, you can run:
    sudo apt-get install qpdf
  2. Open a terminal window and navigate to the directory where the PDF file is located.
  3. Type the following command to remove the password from the PDF file:
    qpdf --password=<password> --decrypt input.pdf output.pdf

    Replace <password> with the password required to open the PDF file. input.pdf is the name of the original PDF file, and output.pdf is the name of the new file that will be created without the password.

    If the PDF file doesn’t have a password, you can omit the --password option.

  4. When the command completes, you should see a new PDF file without a password in the same directory.

Note that the qpdf command-line tool can also be used to encrypt a PDF file with a password, as well as to manipulate other aspects of PDF files. For more information, you can consult the qpdf manual page by running man qpdf in the terminal.

Leave a Comment