From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Use GPG to encrypt, decrypt, sign, and verify files

Use GPG to encrypt, decrypt, sign, and verify files - Linux Tutorial

From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)

Start my 1-month free trial

Use GPG to encrypt, decrypt, sign, and verify files

- We can encrypt and decrypt files with GPG for privacy. We can also sign files as well, ensuring they haven't been tampered with. Let's start by encrypting a file. Let's encrypt the etc password file and save it as a new file. To do so, in a terminal type in, gpg2, space, dash, dash, armor, space, dash, dash, recipient, space, user1, space, dash, dash, output, space, passwd.gpg, that'll be our encrypted file. Space, dash, dash, encrypt, space, and then the file we want to encrypt is slash, etc, slash, P-A-S-S-W-D, and hit enter. We didn't have to use the dash, dash, armor option which saves encrypted files as a text file, but this allows us to view it with cat, so let's do that. Type in cat, space, passwd.gpg, we can see that it's encrypted. Now if you want to decrypt this and display the output on the screen, type in clear and type in gpg2, space, dash, dash, decrypt, space, passwd.gpg. If it prompts you for your…

Contents