Solved

Password protecting a file in linux

Posted on 2001-06-03
8
324 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 25 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

914 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now