1

I was following the advice on this site: http://www.techrepublic.com/article/how-to-easily-encryptdecrypt-a-file-in-linux-with-gpg/

I ran this command: gpg -c test.txt.

But then it created a separate file called test.txt.gpg and it left the original file. I want to encrypt a certain file so that it can't be accessed with a live CD. How can I password protect the original file?

I am using ubuntu and don't want to download a special program.

1

1 Answer 1

3

Well, that's how symmetric encryption with gpg works. You can use the -o option to specify an output. If you want to delete the source file, after successful encryption, you can use something like this:

gpg -c file && rm -rf file

This way you will have encrypted file only. Also, have a look at the shred command, it's quite handy when it comes to deleting sensitive data.

gpg -c file && shred -u file
2
  • Good idea. So something like this would work well? gpg -c [file name] && shred [file name]
    – Lumo5
    Feb 7, 2017 at 14:10
  • 1
    yes, but please test first on non-important files. Also, use shred with -u, as it will 1st overwrite the file contents, and then delete it. If you don't use -u it will only overwrite the file.
    – 13dimitar
    Feb 7, 2017 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .