1.6. Generating an sos report and securing it with GPG passphrase encryption
This procedure describes how to generate an sos report and secure it with symmetric GPG2 encryption based on a passphrase. You might want to secure the contents of an sos report with a password if, for example, you need to transfer it over a public network to a third party.
Ensure you have sufficient space when creating an encrypted sos report, as it temporarily uses double the disk space:
-
The
sosutility creates an unencryptedsosreport. -
The utility encrypts the
sosreport as a new file. - The utility then removes the unencrypted archive.
Prerequisites
-
You have installed the
sospackage. -
You need
rootprivileges.
Procedure
Run the
sos reportcommand and specify a passphrase with the--encrypt-passoption. You can add the--uploadoption to transfer thesosreport to Red Hat immediately after generating it.[user@server1 ~]$ sudo sos report --encrypt-pass my-passphrase [sudo] password for user: sosreport (version 4.2) This command will collect diagnostic and configuration information from this Red Hat Enterprise Linux system and installed applications. An archive containing the collected information will be generated in /var/tmp/sos.6lck0myd and may be provided to a Red Hat support representative. ... Press ENTER to continue, or CTRL-C to quit.Optional: If you have already opened a Technical Support case with Red Hat, enter the case number to embed it in the
sosreport file name, and it will be uploaded to that case if you specified the--uploadoption. If you do not have a case number, leave this field blank. Entering a case number is optional and does not affect the operation of thesosutility.Please enter the case id that you are generating this report for []: <8-digit_case_number>Take note of the
sosreport file name displayed at the end of the console output.Finished running plugins Creating compressed archive... Your sosreport has been generated and saved in: /var/tmp/secured-sosreport-server1-12345678-2022-01-24-ueqijfm.tar.xz.gpg Size 17.53MiB Owner root sha256 bf303917b689b13f0c059116d9ca55e341d5fadcd3f1473bef7299c4ad2a7f4f Please send this file to your support representative.
Verification
Verify that the
sosutility created an archive meeting the following requirements:-
File name starts with
secured. -
File name ends with a
.gpgextension. Located in the
/var/tmp/directory.[user@server1 ~]$ sudo ls -l /var/tmp/sosreport* [sudo] password for user: -rw-------. 1 root root 18381537 Jan 24 17:55 /var/tmp/secured-sosreport-server1-12345678-2022-01-24-ueqijfm.tar.xz.gpg
-
File name starts with
Verify that you can decrypt the archive with the same passphrase you used to encrypt it.
Use the
gpgcommand to decrypt the archive.[user@server1 ~]$ sudo gpg --output decrypted-sosreport.tar.gz --decrypt /var/tmp/secured-sosreport-server1-12345678-2022-01-24-ueqijfm.tar.xz.gpgWhen prompted, enter the passphrase you used to encrypt the archive.
┌──────────────────────────────────────────────────────┐ │ Enter passphrase │ │ │ │ │ │ Passphrase: <passphrase> │ │ │ │ <OK> <Cancel> │ └──────────────────────────────────────────────────────┘Verify that the
gpgutility produced an unencrypted archive with a.tar.gzfile extension.[user@server1 ~]$ sudo ls -l decrypted-sosreport.tar.gz [sudo] password for user: -rw-r--r--. 1 root root 18381537 Jan 24 17:59 decrypted-sosreport.tar.gz