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!

Protect a file with a password

Status
Not open for further replies.

plbiju

Technical User
Oct 3, 2001
11
How to protect a file with password , so anyone knows the password only has to open/read/write/delete that particular file
 
I am sorry. I mis understood your question.
 
You could create a group in [tt]/etc/group[/tt] that has a password, then set the permissions on the file to 070 (----rwx---). Then, when someone wants to access the file, they would use the [tt]newgrp[/tt] command to log into that group. Then they could access the file.

You could also just list these users in [tt]/etc/group[/tt] as members of that group and they wouldn't need to use the password. They would still be the only ones that could access the file, but they wouldn't need a password.

Another approach might be to set an access control list. Do a [tt]man setfacl[/tt] or [tt]apropos acl[/tt] to get more info.

Hope this helps.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top