Solved

encrypted zip with linux

Posted on 2006-11-25
7
1,612 Views
Last Modified: 2008-01-16
hi

I use this command to ackup and zip my database:

"mysqldump  -h $server -u $username -p$password -q $database | gzip > $path "

is there a way to encrypt the ziped file .. ?

thx
0
Comment
Question by:uk1900
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 18013655
Use crypt ...

crypt YourSecretKey < $path > TheEncryptedFile

To decrypt use

crypt YourSecretKey < TheEncryptedFile >  $path

Don't lose YourSecretKey.
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 100 total points
ID: 18015160
or you could actually use zip.

zip -e .......
0
 

Author Comment

by:uk1900
ID: 18015669
thx guys for your help,

u mean I can write :  zip -e $password   in the following command ?

"mysqldump  -h $server -u $username -p$password -q $database | zip -e $password > $path "
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 58

Accepted Solution

by:
amit_g earned 200 total points
ID: 18015793
If you want to do this in one line,

mysqldump  -h $server -u $username -p$password -q $database | gzip | crypt YourSecretKey > $path

If you want to use zip, you can do

mysqldump  -h $server -u $username -p$password -q $database | zip -e > $path

but in case of zip the password (key) is to be entered on the prompt. The command would propnt you to enter a password twice. You can't give that password in command line.
0
 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 100 total points
ID: 18017719
Hi,

zip -e  will always ask for apssword from the standard input and if standard input is redirected to soemwhere else it will print an error message and exit. So it is not possible to run it noninteractively.

For crypt is not a standard application I will suggest you to use GnuPGP. It is a part of most inux Distros.

Visit here for usage info:
http://www.somacon.com/p107.php
http://www.cyberciti.biz/tips/linux-how-to-encrypt-and-decrypt-files-with-a-password.html

Cheers,
K.
0
 
LVL 16

Assisted Solution

by:xDamox
xDamox earned 100 total points
ID: 18019904
Hi,

Have you considered using the GnuGPG when you have your keys setup to encrypt files you simply do:

gpg -e file.zip

Have a read of the following guide I did;

http://www.linux-noob.com/forums/index.php?showtopic=1475
0
 

Author Comment

by:uk1900
ID: 18021672
thx guys for your help
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question