Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
is it possible....
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
honeymak
Guru
Guru


Joined: 30 Dec 2002
Posts: 595

PostPosted: Wed May 19, 2010 1:37 am    Post subject: is it possible.... Reply with quote

to limit some accounts NOT to be su by any others except root?

i don't mean the capability of running the su command

e.g. i want user account A that will never be su by user account B who is capable of running su command
so,

root can su - A
while
userB CANNOT su - A AND userB CAN su - C

:oops:
_________________
hackers - make sth real
academics - read sth said to be real
Back to top
View user's profile Send private message
shazeal
Apprentice
Apprentice


Joined: 03 May 2006
Posts: 208
Location: New Zealand

PostPosted: Wed May 19, 2010 1:50 am    Post subject: Reply with quote

Dont tell userB userA's password? Sorry its hard to see why you would want a system like this in the first place?
Back to top
View user's profile Send private message
honeymak
Guru
Guru


Joined: 30 Dec 2002
Posts: 595

PostPosted: Wed May 19, 2010 12:09 pm    Post subject: Reply with quote

when auditors are at your back,
u know why
_________________
hackers - make sth real
academics - read sth said to be real
Back to top
View user's profile Send private message
rainer
Apprentice
Apprentice


Joined: 17 Feb 2005
Posts: 251
Location: Bonn, Germany

PostPosted: Wed May 19, 2010 12:21 pm    Post subject: Reply with quote

Isn't that what the wheel group is good for?

User A --> member of wheel group --> can su
User B --> not member of wheel group --> cannot su

I'm not sitting in front of my Gentoo machine right now - but that's what I remember...
Back to top
View user's profile Send private message
wthrowe
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2009
Posts: 141

PostPosted: Wed May 19, 2010 1:53 pm    Post subject: Reply with quote

Use sudo instead of su. It allows finer grained control of who can do what as whom.
Back to top
View user's profile Send private message
honeymak
Guru
Guru


Joined: 30 Dec 2002
Posts: 595

PostPosted: Wed May 19, 2010 2:23 pm    Post subject: Reply with quote

hm.....seems this is the missing use case for su/sudo design

i am not needing any capability to be doing anything as anyone

i just want certain accounts that CANNOT be su-ed by any others except root
u may say 'deny to be su-ed except root'
:oops:
_________________
hackers - make sth real
academics - read sth said to be real
Back to top
View user's profile Send private message
rainer
Apprentice
Apprentice


Joined: 17 Feb 2005
Posts: 251
Location: Bonn, Germany

PostPosted: Wed May 19, 2010 2:42 pm    Post subject: Reply with quote

Not sure whether I understand. What do you mean with "be su-ed by any others"?

Probably your problem can be solved by rights allocation.
Back to top
View user's profile Send private message
wthrowe
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2009
Posts: 141

PostPosted: Wed May 19, 2010 2:58 pm    Post subject: Reply with quote

I still think sudo can do what you want, although you might have to list all the allowed users. Something like (UNTESTED)
Code:
Defaults       targetpw = on

Runas_Alias    ALLOWED_SU_TARGETS = userB userC userD everyone_except_userA

Cmnd_Alias     SHELLS = /bin/bash /bin/sh /bin/tcsh /whatever/other/shells/you/use

ALL            ALL = (ALLOWED_SU_TARGETS) SHELLS

And then users can
Code:
sudo -i -u userC
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Wed May 19, 2010 5:31 pm    Post subject: Reply with quote

From what I understand, you want to disallow user A to use so to become user B.

But if user A is allowed to use su, he can su to root, and the su to B. If you want to allow user A to su to some users, but not others, sudo seems to be a better option.

But the simplest solution is to not let the users use su at all.
_________________
http://phajdan-jr.blogspot.com/
Back to top
View user's profile Send private message
honeymak
Guru
Guru


Joined: 30 Dec 2002
Posts: 595

PostPosted: Wed May 19, 2010 11:00 pm    Post subject: Reply with quote

wthrowe's reply is more likely....but seems a tedious task...becoz that's not by design, i can't negate
so i have to do ALL users x ALL targets cases :cry:

phajdan.jr, it's not possible in my situation
:cry: :cry:
_________________
hackers - make sth real
academics - read sth said to be real
Back to top
View user's profile Send private message
honeymak
Guru
Guru


Joined: 30 Dec 2002
Posts: 595

PostPosted: Wed May 19, 2010 11:08 pm    Post subject: Reply with quote

ooops.....seems i just found my answer in sudoers manpage
:oops:

i will give it a try
:twisted:
_________________
hackers - make sth real
academics - read sth said to be real
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum