Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to restrict the su command? Not sudo

3 views
Skip to first unread message

David

unread,
Nov 17, 2003, 6:12:21 AM11/17/03
to
First off, I already know about sudo, that's not what I want.

I'm looking for a method to restrict usage of the su command to
specific users. On Slackware, I had an /etc/suath file where I could
specify which users were allowed to use su but that doesn't seem to
exist with RedHat (or Fedora).

I read in another message that with RedHat you could edit
/etc/security/access.conf to accomplish this. However when I looked
at the file, it appears to only be used to restrict login access.
Restrict console login, restrict remote login, etc... but I don't see
anything that lets you restrict su usage.

I also read that I could create a group ("suusers" or something like
that) and then change the file persmissions of the su command so it's
only usable by root and users in the suusers group. That might be an
option but I'm looking for something closer to the /etc/suath method.

Sybren Stüvel

unread,
Nov 17, 2003, 11:54:05 AM11/17/03
to
On Mon, 17 Nov 2003 03:12:21 -0800, David wrote:

> I'm looking for a method to restrict usage of the su command to specific
> users.

/etc/pam.d/su

Sybren
--
(o_ Q: God, root, what is difference?
//\ A: God can change the byte order on the CPU, root can't.
V_/_


Andrew Ho

unread,
Nov 18, 2003, 9:54:00 AM11/18/03
to
bli...@yahoo.com (David) wrote in message news:<518783f3.03111...@posting.google.com>...

> First off, I already know about sudo, that's not what I want.
>
> I'm looking for a method to restrict usage of the su command to
> specific users. On Slackware, I had an /etc/suath file where I could
> specify which users were allowed to use su but that doesn't seem to
> exist with RedHat (or Fedora).


Why would you want to do that? After all, when you use the 'su'
command, you still need a password.
just curious, that's all. Anyway, a thought I had was to make a group
that people had to be in to execute that command "chgrp suusers
/bin/su", and to make anyone who can use that command a part of that
group

Sybren Stüvel

unread,
Nov 18, 2003, 9:57:41 AM11/18/03
to
On Tue, 18 Nov 2003 06:54:00 -0800, Andrew Ho wrote:

> After all, when you use the 'su' command,
> you still need a password.

That's not entirely true. Read the comments in /etc/pam.d/su.

> just curious, that's all. Anyway, a thought I had was to make a group
> that people had to be in to execute that command "chgrp suusers /bin/su",
> and to make anyone who can use that command a part of that group

Using PAM (as described in my other post in this thread) is a much cleaner
way to solve the issue.

Andrew Ho

unread,
Nov 18, 2003, 2:53:46 PM11/18/03
to
Sybren Stüvel <sybr...@YOURimagination.thirdtower.com> wrote in message news:<pan.2003.11.18...@YOURimagination.thirdtower.com>...

> On Tue, 18 Nov 2003 06:54:00 -0800, Andrew Ho wrote:
>
> > After all, when you use the 'su' command,
> > you still need a password.
>
> That's not entirely true. Read the comments in /etc/pam.d/su.
>
> > just curious, that's all. Anyway, a thought I had was to make a group
> > that people had to be in to execute that command "chgrp suusers /bin/su",
> > and to make anyone who can use that command a part of that group
>
> Using PAM (as described in my other post in this thread) is a much cleaner
> way to solve the issue.
>
> Sybren

Ah yes, you are right, Sybren. And from what I remember when I was
last around this group [one or two years ago], that happens a lot :)
Andrew

Sybren Stüvel

unread,
Nov 18, 2003, 6:16:26 PM11/18/03
to
On Tue, 18 Nov 2003 11:53:46 -0800, Andrew Ho wrote:

> Ah yes, you are right, Sybren. And from what I remember when I was last
> around this group [one or two years ago], that happens a lot :) Andrew

Thanx ;-)

David

unread,
Nov 19, 2003, 5:11:04 AM11/19/03
to
> Why would you want to do that? After all, when you use the 'su'
> command, you still need a password.

Real simple. I don't want anyone on the system to have access to the
su command but me. Has nothing to do with needing a password or not
needing a password. For routine commands that are relatively
harmless, I use sudo with the NOPASSWD option set on a few commands.
But sometimes you need to do a series of commands all in a row. And
... A.) typing sudo in front of all those commands is annoying. and
B.) giving an ordinary user account (even if he's the admin) access to
all those commands via sudo goes against my own personal
administrative philosophy.

I'm not asking you to agree with the way I want to do my work. You
are welcome to administrate your system however you see fit.

> Anyway, a thought I had was to make a group
> that people had to be in to execute that command "chgrp suusers
> /bin/su", and to make anyone who can use that command a part of that
> group

I think I covered that option in my original post. "I also read that

Sybren Stüvel

unread,
Nov 19, 2003, 10:06:23 AM11/19/03
to
On Wed, 19 Nov 2003 02:11:04 -0800, David wrote:

> I think I covered that option in my original post. "I also read that I
> could create a group ("suusers" or something like that) and then change
> the file persmissions of the su command so it's only usable by root and
> users in the suusers group. That might be an option but I'm looking for
> something closer to the /etc/suath method."

Try my suggestion from somewhere else in this thread.

Jacob Westenbach

unread,
Nov 19, 2003, 12:03:23 PM11/19/03
to
"David" <bli...@yahoo.com> wrote in message
news:518783f3.03111...@posting.google.com...

Another approach is to add the desired users to the wheel group and chown
the specific apps to be root.wheel. This is a tedious PITA if there are
very many apps or users involved.

JW


test

unread,
Nov 25, 2003, 7:49:05 AM11/25/03
to
on suggestion if I may, why don't you remove the su command from the default
path and put it in a path that only root can assess or you ,, this mean
updating you .profile pending of which shell you are running this may mean
to modify the path in your proper .profile equivalent file

Good luck
Marc
"Jacob Westenbach" <west...@yahoo.com> wrote in message
news:vnNub.5345$Vs1....@twister.austin.rr.com...

Sybren Stüvel

unread,
Nov 25, 2003, 2:07:28 AM11/25/03
to
On Tue, 25 Nov 2003 07:49:05 -0500, test wrote:

> on suggestion if I may, why don't you remove the su command from the
> default path and put it in a path that only root can assess or you ,, this
> mean updating you .profile pending of which shell you are running this may
> mean to modify the path in your proper .profile equivalent file

Because editing /etc/pam.d/su is much easier. Pam is made so you can
easily edit authentication permissions. By using it, you also make sure
nobody bypasses your suggestion by uploading another su program.

0 new messages