1

How user gpg for encrypt a directory?

example; gpg /home/user/labs-scripts <<< all files in directory or only directory?

thanks for your collaboration.

1 Answer 1

0

Given that gpg will only encrypt a single file (or equivalent) the natural solution is to create a gpg encrypted tarball.

First let me show the two step approach.

$ tar -C /home/user -cf scripts.tar labs-scripts/
$ gpg -r 0xabcdef -e scripts.tar

You can also do it in one sweep, by piping the tar steam.

$ tar -C /home/user -cf - labs-scripts/ | gpg -r 0xabcdef -o scripts.tar.gpg -e

You must log in to answer this question.

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