- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- blocking su access without the -?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2004 07:24 AM
тАО09-09-2004 07:24 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2004 07:45 AM
тАО09-09-2004 07:45 AM
SolutionThe user would then "exit" and do the "su -".
If you really want to restrict access to "su", then do the following -
First change the permissions to /usr/bin/su
to r-s------ so that only root can run it.
Create a small "c" program and call it "sux" and have it call "su -".
Set the permissions on "sux" to
r-sr-xr-x.
This will deactivate "su" from everyone except "root" and force all users to use "sux".
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2004 07:48 AM
тАО09-09-2004 07:48 AM
Re: blocking su access without the -?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2004 07:53 AM
тАО09-09-2004 07:53 AM
Re: blocking su access without the -?
I thought about suggesting something similar to your approach, but the one thing I was concerned about was:
Set the permissions on "sux" to
r-sr-xr-x.
Wouldn't this cause the "sux" program to take on the effective uid of the listed owner of the "sux" binary itself? I think in the su case, it is really helpful to know the real user id of the user who issued the su command. I'm wondering if doing this setuid approach would cause all su logging messages in /var/adm/syslog/syslog.log to indicate that whichever user is listed as the owner of the "sux" program would be considered the user who did the su, as opposed to the real user who ran the "sux" program.
Does this make sense? Am I totally off base here (very likely)? I'd just want to ensure that from an auditing/logging standpoint whatever workaround is used would still log the su command as the real user who issued the "sux" command.
I suppose the "sux" C program could call getuid or geteuid to retrieve the uid/euid of the calling user and then use that information when calling the real su command, and that way it would ensure that the user has permissions to use the su command and switch to the user they're requesting, or gets prompted for a password for the new user. Also, this would hopefully cause the su logging to accurately reflect the user who issued the command.
Again, I could be raising a bogus issue, but the setuid stuff concerns me a bit.
Regards,
Dave
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2004 08:06 AM
тАО09-09-2004 08:06 AM
Re: blocking su access without the -?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2004 08:19 AM
тАО09-09-2004 08:19 AM
Re: blocking su access without the -?
Or maybe set permissions on su as Rodney suggested and set up sudo to run "su -". Since it's so strict in it's interpretation, this would prevent them from using su with the -. That would give you even more flexibility to control exactly who would be allowed to use su at all and you could track executions through sudo's log.
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2004 10:10 AM
тАО09-09-2004 10:10 AM
Re: blocking su access without the -?
how about using sudo, super, nsu, .... in stead of su. You'll have better logging, better control over privileges, ...
regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2004 04:41 PM
тАО09-09-2004 04:41 PM
Re: blocking su access without the -?
mv /usr/bin/su to /usr/bin/suorg
Note: It is good to alter the su* to stepup word so that other's can not identify it. :)
Try to change in the script of suorg to your moved su binary filename there.
cat
# Change permission to
chmod 555 /usr/bin/su
chown bin:bin /usr/bin/su
Regards
Muthu