Syntaxt to zip a file with password protection


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Syntaxt to zip a file with password protection
# 1  
Old 08-21-2008
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 where the file is stored.
ZZZZ is the name of the file.

cd /YYYY;zip -r ZZZZ.zip ZZZZ.TXT

Please let me know the syntax to create the zip file with password protection. I saw some where that we can use "-P password" to make the zipfile password protected, but I am not sure where/how exactly it can be used within the above syntax. Although -P is not safe, it is OK with us, as we are triggering this command from SAP.

This is quite urgent for us.

Thanks in advance.
Veerendranath Maddula.


# 2  
Old 08-21-2008
Code:
cd /YYYY; zip -P password -r ZZZZ.zip ZZZZ.TXT


Last edited by era; 08-21-2008 at 01:01 AM.. Reason: Don't look now, but all your text is green!
# 3  
Old 08-21-2008
Thanks for your reply, but this code is not working for me when I am triggering this command from SAP, is there any other way we can write this code .?

Thanks,
Veerendranath
# 4  
Old 08-21-2008
Be aware that many precompiled versions of zip do not include the encryption capability. You may need to compile and install your own version with the encryption options included. You can check whether it has encryption support by examing the 'special compilation options' in the output of zip -v.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

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? (7 Replies)
Discussion started by: mined
7 Replies

2. 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

3. Shell Programming and Scripting

Password protection in unix

How to create a file in UNIX which is password protected ? Thanks and Regards, Neeraj (5 Replies)
Discussion started by: neeraj617
5 Replies

4. Shell Programming and Scripting

uuencode - .csv file password protection

HI, Can we add password protection for attachment of .CSV file in below command or any alternative solution. uuencode ../reports/gtsa_lmt_pb_rfs_daily.txt gtsa_lmt_pb_rfs_daily-$FILDTE.csv |mailx -s "gtsa_lmt_pb_rfs_daily" $MAILTO Many thanks regards, Sampath (4 Replies)
Discussion started by: Sampath.Rachcha
4 Replies

5. Shell Programming and Scripting

Password Protection using Term::ReadKey

Hi Friends, I execute a perl script with password as input but i wish not to print the password when i give the input. Instead when i provide the password it could be shown as "****" instead of original password. I know we can use Term::ReadKey or IO::Prompt for this, but just wanted to know if... (0 Replies)
Discussion started by: nmattam
0 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. AIX

File password protection/encryption

Can it be done? Ive read in a few places that the crypt program no longer exists on AIX...if its do-able please tell me how. (2 Replies)
Discussion started by: rdudejr
2 Replies

10. UNIX for Advanced & Expert Users

Does unix has password protection for zip files?

How to set password in zip files under unix? There are password protection available in various os. Does unix has password protection for zip files? Is zip and gzip command has it? (6 Replies)
Discussion started by: p_prathaban
6 Replies
Login or Register to Ask a Question