Zip a file with password


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Zip a file with password
# 1  
Old 07-02-2014
Zip a file with password

Hi,

newbie to Linux,

is there another way to zip a file with a password other than using 'zip' command?
# 2  
Old 07-02-2014
I am not sure whether you can give a password to file in unix but as a work arround
you can give following permissions to a file
Code:
chmod 700 filename

So only user who have created it , can read ,write and execute that file.
For his group as well as for other users this file is unaccesable.

Regards,
M. D.
# 3  
Old 07-02-2014
I suppose you could cobble something together with the tar command and give a secret blocksize. I'm not sure how robust it would be though.

What is the requirement? Do you have a file that you need to unlock, or one you need to protect?


Robin
# 4  
Old 07-02-2014
You can use something like ccrypt to encrypt a file with a password.
# 5  
Old 07-02-2014
Quote:
Originally Posted by rbatte1
I suppose you could cobble something together with the tar command and give a secret blocksize. I'm not sure how robust it would be though.

What is the requirement? Do you have a file that you need to unlock, or one you need to protect?


Robin
I have a requirement to zip up a compressed file (yes! no joke) with a password & send it thru the network .. not sure if I can do it ..

---------- Post updated at 08:47 PM ---------- Previous update was at 08:47 PM ----------

Quote:
Originally Posted by Makarand Dodmis
I am not sure whether you can give a password to file in unix but as a work arround
you can give following permissions to a file
Code:
chmod 700 filename

So only user who have created it , can read ,write and execute that file.
For his group as well as for other users this file is unaccesable.

Regards,
M. D.
that will not help .. thanx
# 6  
Old 07-02-2014
Quote:
Originally Posted by mined
I have a requirement to zip up a compressed file (yes! no joke) with a password & send it thru the network .. not sure if I can do it ..
It probably makes not too much sense zipping it again, but you could use

Code:
openssl enc

to encode the file with some cipher. The resulting key would serve as a password then. If it should indeed be compressed a second time just send it through gzip before. If your gzip refuses to cooperate (i could sympathize) use a stream:

Code:
cat file.gz | gzip > outfile.gz.gz

I hope this helps.

bakunin
These 2 Users Gave Thanks to bakunin For This Post:
# 7  
Old 07-03-2014
the stream method works .. many thanx
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (1 Reply)
Discussion started by: b.saipriyanka
1 Replies

2. UNIX for Beginners Questions & Answers

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (2 Replies)
Discussion started by: b.saipriyanka
2 Replies

3. Shell Programming and Scripting

Zip Multiple files to One .zip file in AIX system

Hi I have a requirement in unix shell where I need to zip multiple files on server to one single .zip file. I dont see zip command in AIX and gzip command not doing completely what I want. One I do .zip file, I should be able to unzip in my local Computer. Here is example what I want... (9 Replies)
Discussion started by: RAMA PULI
9 Replies

4. Shell Programming and Scripting

Zip with Password

Hi, In my shell script I am using the zip command to zip the log files. The zip file is password protected. But there is a dicey. I want the output as: 1) All files should be zipped including sub-directories' files 2) All files (individually) should be Password protected (may be common or... (4 Replies)
Discussion started by: MKR
4 Replies

5. UNIX for Dummies Questions & Answers

password protect a CSV file: better solution than ZIP password?

Hi We send *.csv with sensitive data to our customers. Our customers open those files with Excel. A new requirement is that we password protect those CSV files. I thought to pack them with ZIP and assign a password to the archive. But Solaris 10 can't encrypt ZIP files. $ zip -P... (12 Replies)
Discussion started by: slashdotweenie
12 Replies

6. AIX

How to zip file in AIX with password.

Hi Guru, I have assignment to create script to compress file as .ZIP with password. I don't know the command line in AIX. It's very new for me. I'm try to use zip or tar but I don't have any option for encrypt with password. Please kindly suggest me. Thank you very much. Multidev (7 Replies)
Discussion started by: multidev
7 Replies

7. Shell Programming and Scripting

Password protect a zip file

Hi, I'm working on Solaris 9 and i need to unzip a password protected zip, which i can do using zip -Ppassword filename however when i have done what i need to do with the file is to zip the file back up with a password. Zip on my system is version 2.3 and does not support this? How can... (0 Replies)
Discussion started by: Pablo_beezo
0 Replies

8. UNIX for Dummies Questions & Answers

Zip file with password protection

I am trying to zip a file with password protection. I have read all or atleast most of the threads on the website, but couldn't come up with a solution. I am running ZIP version 2.3 on HP-UX but I dont see the -P (password) option. I read somewhere that free versions of zip don't come with... (5 Replies)
Discussion started by: pintu
5 Replies

9. UNIX for Dummies Questions & Answers

Syntaxt to zip a file with password protection

Hi Experts, I am an SAP ABAP developer and compleatly stranger to unix and I need a help to extend a small peice of code. Our requirement is to zip a file with password protection in a specified directory. Following is the code I am using to zip a file ZZZZ.TXT. Here YYYY = is the path... (3 Replies)
Discussion started by: veeru4all
3 Replies

10. UNIX for Dummies Questions & Answers

unzip .zip file and list the files included in the .zip archive

Hello, I am trying to return the name of the resulting file from a .zip archive file using unix unzip command. unzip c07212007.cef7081.zip Archive: c07212007.cef7081.zip SecureZIP for z/OS by PKWARE inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00 I used the following command to unzip in... (5 Replies)
Discussion started by: oracledev
5 Replies
Login or Register to Ask a Question