Saturday 14 October 2017

linux - How do I password protect a .tgz file with tar in Unix?


I'm using the Unix tar command as follows to tar up a directory and its files:


tar cvzf fileToTar.tgz directoryToTar

Is there a way to password protect the .tgz file? I've created password-protected ZIP files on Windows so I would assume Unix has the same capability. Any ideas?



Answer



Use crypt or gpg on the file.


Simple examples:


cat filename | crypt > filename.crypt


gpg -c –o filename.gpg filename


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...