A common answer to remove a PDF password is to run: qpdf --password=supersecret --decrypt input.pdf output.pdf
This approach isn’t secure because it stores your password in terminal history (like .bash_history
). Here’s how to fix that:
qpdf --password="$(read -s -p 'Enter PDF password: ' pw && echo $pw)" --decrypt input.pdf output.pdf
BashIn case you don’t have qpdf, just run sudo apt install qpdf
.
Leave a Reply