Operating System - HP-UX
1819916 Members
2308 Online
109607 Solutions
New Discussion юеВ

Re: How to disable su login (su or su -) in hpux

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to disable su login (su or su -) in hpux

Hi All,

I would like to disable the su login (su or su -) in hpux.

Is it possible.
7 REPLIES 7
Pete Randall
Outstanding Contributor
Solution

Re: How to disable su login (su or su -) in hpux

rm /usr/bin/su

- or -

mv /usr/bin/su /usr/bin/thisisnotsu


Pete

Pete
rariasn
Honored Contributor

Re: How to disable su login (su or su -) in hpux

Hi,

# chmod 000 /usr/bin/su

rgs,
Patrick Wallek
Honored Contributor

Re: How to disable su login (su or su -) in hpux

>>I would like to disable the su login (su or su -) in hpux.

'su' or 'su -' to which accounts?

The easiest way: Don't give out the passwords for the accounts you don't want users 'su'ing to.

I would DEFINITELY NOT change any permission on the 'su' program. That is asking for trouble. If you do that, then any scripts (especially startup scripts) that may do an 'su' to a different user will FAIL.


The problem is not the ability to 'su'. The problem, likely, is too many people having too many passwords.
Steven E. Protter
Exalted Contributor

Re: How to disable su login (su or su -) in hpux

Shalom,

To disable su - for root, you change the pam configuration of the system.

To disable users from using su you have other options.

You can set users up in a group that excludes execute permissions on the binary.

But I strongly recommend you not change permissions on the binary itself.

If you make the request more precise, I can assist you further.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
senthil_kumar_1
Super Advisor

Re: How to disable su login (su or su -) in hpux

Hi Steven,

How to disable the sulogin for all users by using pam configuration?

How to disable the sulogin for set of users?

Don Mallory
Trusted Contributor

Re: How to disable su login (su or su -) in hpux

By wanting to disable su, I am assuming that you are allowing direct root logins to the host. This is a horrible idea.

A more secure approach is to require your administrators to have a named account on the system, forcing them to log in, preferably using ssh, which is configured to log the connection in syslog.

That user must then su - to become root, enterring the password through a secure connection, also proving who it was who performed the account. Thus you will have identity, authentication, and authorisation as well as accountability.

The best way to limit who can use su is via the /etc/pam.conf, however you should add the "pam_hpsec.so.1" option as an additional directive and under /etc/default/security, find the "SU_ROOT_GROUP" and set a "wheel" group. Users must be in this group tu su to root.

Here are the pam.conf directives relating to su.

su auth required libpam_hpsec.so.1 bypass_setaud
su auth required libpam_updbe.so.1
su auth sufficient libpam_krb5.so.1
su auth required libpam_unix.so.1 try_first_pass
su account required libpam_hpsec.so.1
su account required libpam_updbe.so.1
su account required libpam_authz.so.1
su account sufficient libpam_krb5.so.1
su account required libpam_unix.so.1

Note, in my case, there is also pam_authz and pam_krb5, as non-local users authenticate against a windows AD using Kerberos, and authorization is controlled with the Pam_AUTHZ module limiting local login access to members of a specific domain group.

If you weren't planning on implementing something like AD authentication, you could also use pam_authz to specify that users in the wheel group are the only ones allowed to use the su command. Same pam.conf entry as above. In the /etc/opt/ldpaux/pam_authz.policy file, you would hae an entry like this:

allow:unix_group:wheel

This would allow you to keep the IAAA functionality of su for admins, but remove access for all other local users.

Don


Suraj K Sankari
Honored Contributor

Re: How to disable su login (su or su -) in hpux

Hi,

Do not change permission or delete this file..

Don't share the root passwd to anyone...

Implement sudo access for root....


Suraj