I use tar -czf test.tar.gz test/
to compress test
forlder to test.tar.gz
. Now, I want compress to test.tar.gz
with password "mypass"
How can I do?
-
1superuser.com/questions/162624/… – Denis Apr 6 '19 at 13:46
-
another off topic question that i was searching for. thanks stackholes. – user1130176 Mar 6 '20 at 1:32
Neither the tar format
nor the gz format
has built-in support for password-protecting files.
Use crypt or gpg on the
Refer this encrypt-and-decrypt-files-with-a-password for more info.
tar cvvjf - /path/to/files | ccrypt > backup.tar.bz2.cpt
or
ccrypt backup.tar.bz2
You can also use zip
zip -e file.zip file
Will ask you on a prompt for a password. It is more secure then passing the password via the command line via zip -P password
.
-
But I want enter password on my compress command. Can you help me with this? – abent Jul 14 '14 at 10:20
-
8
-