Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm wondering if its possible to password protect a directory.
I have a directory: /home/bob/scripts
I realize I can change permissions on this directory and I have done that 'chmod 700 /home/bob/scripts' did the trick, so becoming root allows me access to the directory and no other users, including bob. That works fine but I would like to make it so a password is required to access that dir. Is there a way to do that other than becoming root to access it?
The obvious route is gpg encryption see - http://www.gnupg.org/documentation/ If you use kde then the facility is available under Utilities.
__________________
Registered Linux User #349859
Hmmm...
TigerOC, if it was that obvious, do you think I would post a question in here? Thats why I posted in Linux 'NEWBIE'!
Freestone - I would recommend that you not jump on people that try to help you. You will get more willing help if you do not. I imagine what "obvious" meant is that if you had tried a search of the forums, with the search string "password protect directory", then you would have found some good info.
I will assume you're just having a rough day, and I'll try to offer you some more tips. One thing you might investigate is TrueCrypt. This creates an encrypted container (a file or partition or disk), and you can mount this container as a directory structure. A password is required to mount the container.
There is not much you can do to keep root out of your files, by way of file permissions and such, if that was your plan. Encryption can make things quite difficult for root, but not impossible, if you're being watched and observed by a good sysadmin WHILE you're doing your decrypting. An encrypted file is safe enough (given good encryption), but once you decrypt the thing into memory - root can get at it. It's work, but it can be done.
You can also investigate a password protected zip file. Or gpg, as was already mentioned.
adding to haertig, i dont think he was being rude or trying to be by using 'obvious'. i think he was trying to say, besides the previous search tactic, that there are many ways to do this, and since you use KDE then the software to do it should already be availble on your system and thats the quickest and best solution right now.
TigerOC replied:Hmmm... TigerOC, if it was that obvious, do you think I would post a question in here? Thats why I posted in Linux 'NEWBIE'! Sheesh.
Hmmm... a newbie and ironic too. Should make your presence in the forums interesting. Your original statement and question;
Quote:
I realize I can change permissions on this directory and I have done that 'chmod 700 /home/bob/scripts' did the trick, so becoming root allows me access to the directory and no other users, including bob. That works fine but I would like to make it so a password is required to access that dir. Is there a way to do that other than becoming root to access it?
The quickest and easiest route and therefore the most obvious route that I know of, would be gpg encryption to achieve what you desire. The use of the word obvious is not intended to belittle you but is a statement of generality. i.e. the first thing that comes to mind in this context. There are, of course, others who have might have a different opinion and this may not be obvious to them. I suggest that you read replies in the spirit that they are given and not with the preconceived notion that someone is having a go at you. The fact that I have made in excess of 2000 posts would seem to indicate that I have an interest in helping others else I wouldn't bother.
TigerOC, I apologize for being an ass. This is a great forum and I regret doing something that would make it other than great. I have received a lot of help at LQ and I have helped others as well.
Having said that, I apologize for being a rude and flaming idiot in my response to you. These forums are about computers and I realize that. I am going through a very trying time in my personal life and I know for a fact that I used you to vent my frustrations. You, or this forum, are not the appropriate outlet.
I sincerely apologize for acting in a way that was offensive to anyone.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.