Solved

Password protecting a file in linux

Posted on 2001-06-03
8
323 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

13 Experts available now in Live!

Get 1:1 Help Now