Decrypt backup.txt.gpg and write the result to backup.txt.
Which command is appropriate?
Use --decrypt to decrypt the input and --output to choose the destination file.
Detailed explanation
gpg --encrypt backup.txt.gpg --output backup.txtCorrect. --decrypt reads the ciphertext and --output writes the plaintext to backup.txt.
gpg --decrypt backup.txt.gpg --output backup.txtIncorrect. --encrypt performs encryption, not decryption.
gpg --sign backup.txt.gpg --output backup.txtIncorrect. --sign creates a signature.
gpg --list-keys backup.txt.gpg --output backup.txtIncorrect. --list-keys lists keys and does not decrypt files.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' 'gpg --decrypt backup.txt.gpg --output backup.txt'Expected result
gpg --decrypt backup.txt.gpg --output backup.txtKey points
- --decrypt
- --output
- Opposite of encryption
Notes
- Environment: GnuPGのコマンド役割確認
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Host key
A server identity key used by SSH clients to detect a changed endpoint.
User key
A key pair used to authenticate a user to an SSH server.
Port forwarding
An SSH tunnel that carries traffic between a local, remote, or dynamic endpoint.