GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- about the shutdown command
Operating System - HP-UX
1844750
Members
2432
Online
110233
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
10-15-2006 07:56 AM
10-15-2006 07:56 AM
Hi,
i have this question for long time,
how u will prevent urself from doing a shutdown command when u r the root?(shutdown or any dangerous command)
sometime back, when i want to run shutdown command in one box, i did that command in another box. since both are test machines, i got no problem.
and also, the shutdown command's persmission is:
-r-sr-xr-x 1 root bin 266240 Apr 12 2000 shutdown
what is the "s" in the permissions and what is meant by root and bin(next to the permission and the "1")?..is it like, the owner of this file is bin and root only can execute it???
i have this question for long time,
how u will prevent urself from doing a shutdown command when u r the root?(shutdown or any dangerous command)
sometime back, when i want to run shutdown command in one box, i did that command in another box. since both are test machines, i got no problem.
and also, the shutdown command's persmission is:
-r-sr-xr-x 1 root bin 266240 Apr 12 2000 shutdown
what is the "s" in the permissions and what is meant by root and bin(next to the permission and the "1")?..is it like, the owner of this file is bin and root only can execute it???
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2006 08:42 AM
10-15-2006 08:42 AM
Solution
Hi:
The only way to prevent yourself from doing a shutdown command when you are root is (1) *not* to do it; or (2) don't operate as 'root' unless you absolutely need to do so!
The 'shutdown' binary is owned by 'root' and has its 'setuid' bit set. That's the "s" you see in the owner's permission in place of an "x". This means that anyone who can execute the command (as given by the group and world-wide) execute permissions) can run 'shutdown' *as if* they were 'root'. That is, the executing user's effective uid becomes zero (root).
Now, that would be disasterous *if* things the code were that simple. Normally, only 'root' can perform 'shutdown'. However, if you create '/etc/shutdown.allow' you can add 'root' AND other users to the file to denote that they have the privilege to perform 'shutdown'. You must include 'root' in the file.
For a full description of how to create an '/etc/shutdown.allow' file, see the manpages for 'shutdown':
http://www.docs.hp.com/en/B2355-60127/shutdown.1M.html
Regards!
...JRF...
The only way to prevent yourself from doing a shutdown command when you are root is (1) *not* to do it; or (2) don't operate as 'root' unless you absolutely need to do so!
The 'shutdown' binary is owned by 'root' and has its 'setuid' bit set. That's the "s" you see in the owner's permission in place of an "x". This means that anyone who can execute the command (as given by the group and world-wide) execute permissions) can run 'shutdown' *as if* they were 'root'. That is, the executing user's effective uid becomes zero (root).
Now, that would be disasterous *if* things the code were that simple. Normally, only 'root' can perform 'shutdown'. However, if you create '/etc/shutdown.allow' you can add 'root' AND other users to the file to denote that they have the privilege to perform 'shutdown'. You must include 'root' in the file.
For a full description of how to create an '/etc/shutdown.allow' file, see the manpages for 'shutdown':
http://www.docs.hp.com/en/B2355-60127/shutdown.1M.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2006 12:18 PM
10-15-2006 12:18 PM
Re: about the shutdown command
Thanks JRF,
and one question i have,
from the path, if i remove /usr/sbin, then whatever sbin commands i need to use, i should use full path only, like "/usr/sbin/shutdown -r". is that will work? is that idea fine?
and one question i have,
from the path, if i remove /usr/sbin, then whatever sbin commands i need to use, i should use full path only, like "/usr/sbin/shutdown -r". is that will work? is that idea fine?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2006 01:05 PM
10-15-2006 01:05 PM
Re: about the shutdown command
I would not remove /usr/bin/ from your PATH. There are lots of commands and utilities in /usr/bin that you would then have to use the full path for those commands.
Your original situation, accidentally shutting down the wrong machine, is why you MUST always know which machine you are working on.
This is one reason I include the hostname in my prompt on ALL machines.
Your original situation, accidentally shutting down the wrong machine, is why you MUST always know which machine you are working on.
This is one reason I include the hostname in my prompt on ALL machines.
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