File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes How to set permissions for specified users Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "How to set permissions for specified users" Watch "How to set permissions for specified users" New topic

How to set permissions for specified users

Minal Silimkar-Urankar
Ranch Hand

Joined: Nov 25, 2007
Posts: 136
I want to set some specific permissions for specified users only.
Like read permission for specified files for selected users only.

How I will do that?
[ March 17, 2008: Message edited by: minal silimkar ]

Minal Silimkar
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17272

You can set up a special group, add the users to that group, then set the group ownership of the files and directories.

For even finer control, you can use Selinux, but that's too complicated to describe here.

An IDE is no substitute for an Intelligent Developer.
Anand Hariharan

Joined: Aug 22, 2006
Posts: 272

Which OS, Minal?

In AIX, one has 'setfacl' that can be used to do exactly what you want. Solaris had something similar, but not so easy to use as AIX.

Tim is right, of course, but to create a group with specific users, one needs administrative privileges.

- Anand

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery
I agree. Here's the link:
subject: How to set permissions for specified users
It's not a secret anymore!