LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-07-2008, 04:43 AM   #1
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Rep: Reputation: 107Reputation: 107
Unhappy restrict a user to certain command


Hi all,

I am using Sun OS 5.10. I am new to Unix.

Is there some way to restrict a specific user to certain command say "/usr/bin/more" ??
for example: I want that user1 can execute more command & user2 can't.


Can we somehow edit .profile file in the home directory of user to achieve this ??
OR
is there some other way ??

Pls help.

Thanks N Regards,
VIKAS
 
Old 03-07-2008, 05:26 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Does Sun have acl's and does the filesystem support them?

In Linux I would use: sudo setfacl -m u:<usesname>:000 /usr/bin/more

You couldn't allow reading either because then the use could simply copy the command to ~/bin/.
 
Old 03-07-2008, 05:47 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Yes, Solaris supports POSIX draft ACLs on ufs since 2.5 (1996). There is also NFSv4 ACLs support with ZFS.

Alternatively, you use RBAC (role based access control) to limit or expand what users are allowed to do under Solaris.
 
Old 03-07-2008, 11:23 PM   #4
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Original Poster
Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by jschiwal View Post
Does Sun have acl's and does the filesystem support them?

In Linux I would use: sudo setfacl -m u:<usesname>:000 /usr/bin/more

You couldn't allow reading either because then the use could simply copy the command to ~/bin/.



Hi jschiwal,


Code:
setfacl -m u:user2:000 /usr/bin/more
is giving error

"Unrecognized character found in mode field"


Pls help !!
 
Old 03-08-2008, 03:28 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Try a single dash instead of 000. I wasn't sure how to indicate that all the permissions should be cleared and 000 worked.
According the the manpage for my version of setfacl, the perm field can be an octal number.
 
Old 03-08-2008, 03:58 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Code:
setfacl -r -m u:user2:--- /usr/bin/more
A single 0 works too.

Last edited by jlliagre; 03-08-2008 at 04:00 AM.
 
  


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
Restrict user sunhui Linux - Software 2 09-21-2006 06:11 PM
Restrict command to run sunhui Linux - Software 4 05-25-2006 04:06 AM
How to restrict user permissions solnitza Linux - Newbie 5 08-26-2005 03:58 PM
how to restrict the user simi_virgo Linux - Newbie 2 02-25-2005 06:31 AM
How to restrict user (FTP)? Rex_chaos Linux - Networking 2 03-19-2003 04:48 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 05:01 PM.

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