Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password Protect a folder on Unix

Status
Not open for further replies.

scottpeter

Programmer
Sep 23, 2003
28
US
Is there any way to protect a folder with Password on UNIX.

I am using a group ID and do not want that others in the group should be able to see the contents of this folder.

Thanks,
Scott
 
chmod go-rx /path/to/folder

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Thanks for your answer. Your solutions removes the privileges from 'g' and 'o'.

But what I meant to say was that
e.g., I am using a Id 'u111111'. 'u111111' is owned by my team. Hence others in the TEAM have access to this Id and Password. When they log in using this Id they can see the contents in the folder. How can I make this folder secure?.

I know that no two people should share an Id. But this is how it is in the place where I work. I do not have an individual Id. I need to use the Team Id.

Thanks,
Scott

 
Ask your sysadmin to create a brand new account, then:
chown newaccount /path/to/folder

To see the content of the folder you'll use by using:
su newaccount

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
They wont create a new account. Can this be done in the same account.

thanks,
scott
 
If you set all permissions to read/write for user and nothing else (i.e. no permissions for group / everyone) then no-one will be able to read anything in that directory.

Is that enough or do you need something else?


Trojan.
 
Write the Contents of the directory to a CDROM and put in your Desk. Then Delete the Directory.

When you want to see the files, remount the CD.

Sorry UNIX DIrectory/File permissions are very limited.

Maybe there is an encryption package that you can use to Encrypt the whole directory and then only your group will have the Key to Decrypt the file to a TEMP location when you want to view it or modify it and then encrypt it again as you write it back to the directory.

Which flavor of *NIX are you using?
AIX, Solaris, Linux, SCO?

Maybe they have some proprietary File system format that can do what you want.

Maybe you could make CVS/SCCS repository to house the files and limit access via the CVS manager?



 
You can cheat a little, but it will require assistance from a sysadmin.
Under your home directory, create a new directory owned by root with these permissions:
drwx--x--x 3 root sys 512 Oct 25 07:19 archive

Within that "archive" sub-directory, create the directory you wish to have exclusive access to. Name it something hard to guess (just like a password would be).
# cd archive
# mkdir hicknild
# chown u11111 hicknild
# chmod 755 hicknild

Now there is a directory named /home/u11111/archive/hicknild, but only you (and everybody reading this post) are aware of its existence.

Log in as you normally would and set a variable:
$ SAFE=/home/u11111/archive/hicknild

When you wish to go to that directory, just do this:
$ cd $SAFE

Due to the permissions of the parent directory, only a superuser would be able to even see that subdirectory name.
 
I am not sure whether the sysadm will go out of his way to do something like this. I will give a try.

By the way I am using HPUX.

Or is it possible that I somehow encrypt the files or give a password to the files.

Thanks,
Scott
 
What sort of files are they?
Vim has a "-x" switch for file encryption. Not sure if "vi" does also.
Of course you can encrypt files. Check to see if you have gpg installed.


Trojan.
 
man crypt
man vi (the -x option)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top