Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Password protecting a file in linux

Posted on 2001-06-03
8
Medium Priority
?
330 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

 
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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

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 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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

719 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