This content has been marked as final. Show 8 replies
The following works for me:
Your problem was that you did not specify a zip file.
$ zip -P mypwd hr.zip hr.dmp adding: hr.dmp (deflated 79%) $ unzip hr.zip Archive: hr.zip [hr.zip] hr.dmp password: ^C $ unzip -P mypwd hr.zip Archive: hr.zip inflating: hr.dmp
Note that while the zip or unzip command runs, everyone can see the password using the standard 'ps -ef' command.
965652 wrote:I must be missing something! The whole point of using zip -e is to get a prompt. The whole point of using the insecure zip -P is to not get a prompt. If you want a prompt use zip -e. If you don't want a prompt the use zip - P !
Nope. If I am using zip -e its prompt for the password. Whereas for zip -P we should mention the password in command itslef. So If i am gonna user zip -e in the script, how I can avoid the password prompting ?
Thanks for the update.
I would like to know one more point. Is there any password protection available for gzip. I tried googling and I coudlnt find any password protection feature for gzip. Current we are using gzip for the backup compressions. We would like to continue the same instead of going for zip -P just because of the reason of password protection. Kindly suggest.
How about using gpg and adding a secret key to the requirement of a password? No one should be able to decrypt your file, not by knowing only the password.
1. Generate a public and private key pair:
$ gpg --gen-key
When it shows "We need to generate a lot of random bytes…" open another terminal session and type "dd if=/dev/sda of=/dev/null" to create traffic. When the public and secret key created and signed you can Ctrl-C the dd command.
To see what you have created:
$ gpg --list-keys
2. Encrypt and gzip your stuff:
$ tar zcf stuff.tgz file_or_folder
$ gpg recipient "Some Name" encrypt stuff.tgz
$ rm -f stuff.tgz
3. Decrypt and extract the archive:
$ gpg batch yes --passphrase "password" -d stuff.tgz.gpg > stuff.tgz
$ tar zxvf stuff.tgz
Again, knowing the password alone will not let anybody decrypt your stuff.