HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Restricing sudo users from 'su -'
Operating System - HP-UX
1832494
Members
5728
Online
110043
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
04-22-2002 06:46 AM
04-22-2002 06:46 AM
Hi all... I couldn't find any information on this in the man pages so I thought I'd try the forum. We'd like to give certain users access to every command (i.e. ALL=NOPASSWD: ALL), but we want to restrict them from logging in as root from sudo (i.e. sudo su -). Is this possible?
Thanks a bunch!
Thanks a bunch!
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2002 06:56 AM
04-22-2002 06:56 AM
Re: Restricing sudo users from 'su -'
Hi Todd
There is a simple way to do that ; here is a script we use for the user not to login as root , this can be expanded and used to restrict selective users too. These lineas are to be inserted in /etc/profile .
loginid=`who am i | awk '{print $1}'`
echo $loginid
if [ $loginid = root ]
then
exit
fi
Manoj Srivastava
There is a simple way to do that ; here is a script we use for the user not to login as root , this can be expanded and used to restrict selective users too. These lineas are to be inserted in /etc/profile .
loginid=`who am i | awk '{print $1}'`
echo $loginid
if [ $loginid = root ]
then
exit
fi
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2002 06:59 AM
04-22-2002 06:59 AM
Solution
This has good examples on how to configure your sudoers file to achieve what you want ..
http://www.courtesan.com/sudo/man/sudoers.html#examples
From the manual .. (some examples ..)
jen ALL, !SERVERS = ALL
The user jen may run any command on any machine except for those in host SERVERS
jill SERVERS = /usr/bin/, !SU, !SHELLS
For any machine in the SERVERS Host_Alias, jill may run any commands in the directory /usr/bin/ except for those commands belonging to the SU and SHELLS Cmnd_Aliases.
http://www.courtesan.com/sudo/man/sudoers.html#examples
From the manual .. (some examples ..)
jen ALL, !SERVERS = ALL
The user jen may run any command on any machine except for those in host SERVERS
jill SERVERS = /usr/bin/, !SU, !SHELLS
For any machine in the SERVERS Host_Alias, jill may run any commands in the directory /usr/bin/ except for those commands belonging to the SU and SHELLS Cmnd_Aliases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2002 07:20 AM
04-22-2002 07:20 AM
Re: Restricing sudo users from 'su -'
Thanks guys!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP