If you have pdftk already installed you can skip step1
Step 0: To check if Pdftk is already installed
sudo apt list | grep pdftk
If output contains '[installed]' tag with pdftk then you can skip step1 i.e if the output is like this
pdftk/xenial 2.02-4 amd64 [installed]
Step 1: Install pdftk
sudo apt-get install pdftk
Step 2: Run following command
pdftk /path/to/input.pdf input_pw <yourpassword> output out.pdf