Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Password protecting a file in linux

Posted on 2001-06-03
8
Medium Priority
?
331 Views
Last Modified: 2012-05-04
Is it possible to password protect a file in Linux ?
By this I mean that when anybody is going to view the file (whatever be the way he choose) it will ask for a password and if valid password is entered it will open the file.
                                 If any body found any hints or any suitable link just help me.
0
Comment
Question by:souvik_mss
8 Comments
 
LVL 5

Expert Comment

by:garboua
ID: 6152852
I don't know if you can password protect a file, but you can set the permission to deny all from read or write except a spcific group and you can add users to that particular group.

Through the WeB, it is a whole different story and it is EASY,
http://www.treefiddy.com/linux/htaccess.html
hope this helps
0
 

Author Comment

by:souvik_mss
ID: 6155120
I don't mean to protect file through the web. I am aware about the htaccess and I don't want this. File permission is good but I want to protect the file as it can be done in MS-Word. Even if the person know my login password then also he has to know the file password seperately to open the file.
Thanks for your help.
0
 
LVL 10

Expert Comment

by:rbr
ID: 6155264
man crypt
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 6

Expert Comment

by:graham_k
ID: 6159155
then why not use an archiving program, like tar or zip, etc?  I'm not if tar lets you add passwords to archives, but zip does (see http://www.visi.com/cgi-bin/man?zip+1).
0
 
LVL 3

Accepted Solution

by:
alien_life_form earned 100 total points
ID: 6171075
as mentioned by rbr crypt will let you do what you are
after.
Safer protection may be achieved by using gnupg or pgp.

Though I have never used them to this end, the programs in the openssl suite perform this task in a way that's very similar to what crypt does (so I lump them with crypt
in what follows) but using muche stronger ciphers.

This means you will be able to:

(i) crypt your files with a password of your chosing (crypt) or with your (public) key (pgp/gnupg)

(ii) decrypt your files with the same password as in (i) or with your private key (*pg)

If you are using pgp or gnupg the crypt/decrypt process is authomated so you never need to know which password is being used  - OTOH, if you want to circulate the files you have encrypted, you will have to use a differente technique.

What you do not get is application level support for
your now encrypted files. I believe that the only en-user applications that have widespread  support for encryption are mail readers. (this means you'll have to manually decrypt your stuff before uou can use it.


If this is not acceptable, perhaps using the encryption built in zip eetension, as suggested by a previous poster.
Cheers,
     alf


If that is important
0
 
LVL 5

Expert Comment

by:garboua
ID: 6464037
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9868826
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: alien_life_form {http:#6171075}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
Integration Management Part 2
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

886 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