- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to setup " /usr/bin/su " can not be run by usi...
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
тАО11-17-2008 01:42 AM
тАО11-17-2008 01:42 AM
If i want users can run all commands but only one command " /usr/bin/su" cannot be run. Then how to setup it.
I have try to setup is as follows :
eric prodsvr = noexec : /usr/bin/su
and login eric then run as follows :
$ sudo su
>>> sudoers file: syntax error, line 23 <<<
sudo: parse error in /usr/local/etc/sudoers near line 23
why ? someone help me ? Thanks a lot.
BR
eric
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2008 01:59 AM
тАО11-17-2008 01:59 AM
Solution"whoami" will report the user you su to.
In this way, depending on the login shell you are using, you can modify .profile/.cshrc/.login of your
paticular user account accordingly to suit your needs.
For example, add the following to the beginning of your oracle's .profile:
=============================================
trap "" 1 2 3
if [ "who am i|awk '{print $1}' != "whoami" ]
then
# this implies an su, thus proceed on
# with the rest of your command executions.
else
# this user must have logged on direct
# without su'ing thus logout this user
logout
fi
trap 1 2 3
=============================================
To prevent your user from modifying his own .profile to workaround it, remember to change the ownership of oracle's .profile to root and chmod 755 the .profile.
Thanks,
Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2008 10:31 AM
тАО11-17-2008 10:31 AM
Re: how to setup " /usr/bin/su " can not be run by using sudo tools
See:
http://www.courtesan.com/sudo/man/sudoers.html#noexec_and_exec
the example they give is:
aaron shanty = NOEXEC: /usr/bin/more, /usr/bin/vi
which allows aaron to run "more" and "vi", but not break out to a new shell from them which would allow them priviledge (root) access to everything.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-26-2008 12:23 AM
тАО11-26-2008 12:23 AM
Re: how to setup " /usr/bin/su " can not be run by using sudo tools
Great, and it works now. Thank you very much.
Best Regards
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-26-2008 09:31 PM
тАО11-26-2008 09:31 PM
Re: how to setup " /usr/bin/su " can not be run by using sudo tools
Edit sudoers file add add
username ALL=(ALL) ALL, !/usr/bin/su
This will allow user to run all command except su
Regards,
Javed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 01:59 AM
тАО11-27-2008 01:59 AM
Re: how to setup " /usr/bin/su " can not be run by using sudo tools
you can prevent using sudo su - by :
username ALL=(ALL) ALL, !/usr/bin/su
but user still can copy /usr/bin/su to another location and can run with sudo and gain root access. i couln't find a solution to 'ALL' phrase.
Kenan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-27-2008 12:41 PM
тАО11-27-2008 12:41 PM
Re: how to setup " /usr/bin/su " can not be run by using sudo tools
Hmm, I first thought that may not work but it seems you may be right.