How to ZIP all files and folders in a folder with a password?

Joined
Jul 8, 2016
Messages
48
Best answers
0
Ratings
8
Points
8
#1
My website is putting in public_html and I want ZIP all files and folders in this folder with a password? file format should be .zip and it needs a password to protect file. When I download it to Windows, I need to use password to open it. How can I do this?

Normally I am using this code zip -r filename.zip * .htaccess but I need to add password while creating zip file. can anyone help?
 
Joined
Nov 9, 2018
Messages
18
Best answers
0
Ratings
3 1
Points
3
#3
That's easy.
You just zip them and set up a password during the "zip initiation" process. :D
 

Chris Worner

Well-known member
Joined
Apr 15, 2016
Messages
460
Best answers
1
Ratings
41
Points
28
#4
That's easy.
You just zip them and set up a password during the "zip initiation" process. :D
This way is easy if you are using Windows and having a zip program to help you compress your files. It will be not easy if you are using Linux.

I got this from them
The command goes something like,
zip --encrypt foo.zip foo.txt which asks for password on terminal,
Enter password:
Verify password:
updating: foo.txt (stored 0%)
So when we need to open a zip file or extract this foo.zip from SSH, how to open/extract it with a password?
 

VirtuBox

Global Mod
Staff Member
Joined
May 3, 2016
Messages
1,611
Best answers
4
Ratings
450 13
Points
83
#5
My website is putting in public_html and I want ZIP all files and folders in this folder with a password? file format should be .zip and it needs a password to protect file. When I download it to Windows, I need to use password to open it. How can I do this?

Normally I am using this code zip -r filename.zip * .htaccess but I need to add password while creating zip file. can anyone help?
Hello,
if you usually use :
Bash:
zip -r filename.zip * .htaccess
You just need to add "-P yourpassword" to your command :

Bash:
zip -r filename.zip * .htaccess  -P yourpassword
 
Similar Threads
Replies
4
Views
1,776
Replies
8
Views
3,775

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top