> Let's say I want ~/.prn to be password protected, how can I do that?

Not sure if this is the easiest way, but you could encrypt it with gpg.

Nautilus (GNOME's file manager) has a plugin for doing this graphically.
If you use Nautilus, install the plugin with

$ sudo apt install seahorse-nautilus

and you'll have to option to encrypt a file by right clicking on it. I
haven't tried this myself, so I'm not sure if you'll be able to encrypt
directories.

If you use Caja (MATE's file manager), there is also a plugin but it is
not in Trisquel's repository.
https://github.com/darkshram/seahorse-caja/

Again, I'm not sure if that works on directories, or just files.

Alternatively, you can do all this from the command line:

To encrypt a file, run

$ gpg -c /path/to/file

You'll be prompted to enter a password twice, and /path/to/file.gpg will
be created. If you then delete the original,

$ srm /path/to/file
(you might need to run "sudo apt install secure-delete" first)

then only the encrypted file will remain.

To decrypt it, run

$ gpg /path/to/file.gpg

Enter the password you created earlier, and the file will be decrypted.

This only works on files, not directories. However, you could either
encrypt each file individually (assuming you don't mind the directory
structure being visible)

$ cd ~/.prn
$ for file in $(find -type f); do gpg -c $file && srm $file; done

or convert the directory to a file and encrypt that.

$ cd ~
$ tar cf .prn.tar .prn
$ gpg -c .prn.tar

Before deleting the original, make sure that you can successfully
decrypt .prn.tar.gpg with

$ gpg ~/.prn.tar.gpg

and extract the resulting .prn.tar with

tar xf ~/.prn.tar

When you're ready to delete the originals,

$ srm .prn .prn.tar

Attachment: signature.asc
Description: PGP signature

Reply via email to