Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How user gpg for encrypt a directory?

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

thanks for your collaboration.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.