LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2006, 05:49 AM   #1
sailu_mvn
Member
 
Registered: Sep 2004
Location: Hyderabad
Distribution: FEDORA,REDHAT,HOST
Posts: 440
Blog Entries: 1

Rep: Reputation: 30
Thumbs down password protect a directory in Linux


in windows, if i want i can passwd protect any directory which i need to restrict access to. Is there any such utility in linux?
I know file permissions can be used but still is there any utility
 
Old 05-24-2006, 06:23 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Hi!

You may want to take a look into The GNU Privacy Guard. You can easily protect files and directories with passwords like this:

Code:
$ gpg -c filename
 
Old 05-24-2006, 06:28 AM   #3
Jaqui
Member
 
Registered: Jan 2006
Location: Vancouver BC
Distribution: LFS, SLak, Gentoo, Debian
Posts: 291

Rep: Reputation: 36
not that I have seen, using GROUP permissions is the usual way to control access to folders or files.
 
Old 05-24-2006, 06:52 AM   #4
PsypherPunk
Member
 
Registered: Jul 2005
Posts: 109

Rep: Reputation: 15
Quote:
Originally Posted by Mega Man X
You can easily protect files and directories with passwords like this:

Code:
$ gpg -c filename
That's actually a pretty groovy idea. How would you actually use the directories once encrypted though? Could it be done without decrypting them and creating a decrypted file?
 
Old 05-24-2006, 07:02 AM   #5
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
password protect from whom? if you are 'root' nobody can see your files. if you are a user nobody except 'root' can see your files (you can use chmod 700 on all your files) and even if you do find a program that lets you password protect your files, the 'root' may easily bypass them unless you encrypted them even so there is no guarantees.

remember 'root' is supreme, 'root' is GOD!
 
Old 05-24-2006, 07:46 AM   #6
Spudley
Member
 
Registered: Mar 2003
Location: Berkshire, England.
Distribution: SuSE 10.0
Posts: 299

Rep: Reputation: 32
If the person you want to protect the files from is logging in to the computer with a different user name, then it's easy -- just set the file permissions so that only the file owner can read it.
(setting file permissions -- command line: use the chmod command; in KDE: right-click on the file, and select 'permissions')

If the other person is logging in to the machine using the same login credentials as you, then you're missing all the fun: Linux is a fully multi-user system; each person can have their own log in, and once they're logged in, its like they've got the system to themselves -- they can then set up the environment just how they like it without interfering with anyone else's settings.

I guess it's just possible that you have two people using the same login, and you really don't want to have to change that (maybe you both share the same mailbox or something?). In that case, you're going to need to encrypt the files or something like that. You could log in as root and change the permissions to that only the root user can see the files, but that's not really what you should be using the root login for.

Hope that helps.
 
Old 05-24-2006, 02:20 PM   #7
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Linux has a great cryptography api built into the 2.6 kernel. This would probably be the most secure way to protects your files, even from root. I don't think even the NSA (or your countries equivalent) has the capability to crack a good twofish crypto scheme.

I used this guide to set it up on my own system.

Let me know if you need any help with it.

regards,
...drkstr

Last edited by drkstr; 05-24-2006 at 02:22 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protect souvik Programming 3 11-06-2015 01:35 PM
Password protect a directory aquatux SUSE / openSUSE 6 08-01-2005 11:56 PM
How Can I password protect a sub-directory of a hosted website from client PC mark001 Linux - Newbie 18 11-12-2004 02:29 PM
How to password protect a web directory abdulber Linux - Software 1 01-27-2004 11:34 PM
Password protect a directory Stephanie Linux - General 6 03-26-2002 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration