Thursday, December 11, 2014

How to protect files & folders with password in Linux

only for file protection
gpg  –c  abc.tar
gpg abc.tar

protection for file & Folder both 
zip  –e  -r  <dir name>   <zip dir name which must be same as dir name> 
zip  -e  -r  yy yy
unzip –a yy.zip

Hide a file or folder in Linux
=========================
Just rename the file or folder with prefix dot i.e
Eg:

File name or folder name is hello
#mv  hello  .hello

**********************************************************************

You can password protect a zip file. Proceed as follows:

Create a directory for this experiment, and name it test.
Copy a few files and paste them into this directory so it isn't empty.
Now open a terminal and enter:
$ zip -e -r test test
Enter password:
Verify password:
Delete the directory test.

Now you have a file test.zip which is password protected.

zip with -e option encrypts the contents of the zip archive using a password. This encrypts with standard pkzip encryption which is considered weak.

However, the job of protecting the file is done, because even the root user needs the password to decrypt.

No comments:

Post a Comment

TCP/UDP Protocols/Prots & important port numbers in Linux OS

TCP/UDP Protocols/Ports are ranging from 0-65535 so total we have 65536 ports & because of the limitation in TCP/IP stack where the por...