Operating System - HP-UX
1833785 Members
2907 Online
110063 Solutions
New Discussion

Re: create user able to shutdown the system

 
SOLVED
Go to solution
meekrob
Super Advisor

create user able to shutdown the system

hi all ,
i need to create a user on a HP-UX system that has the capability to shutdown the system automatically when it log in ,

how can i create this user ?
thank you
5 REPLIES 5
melvyn burnard
Honored Contributor
Solution

Re: create user able to shutdown the system

You add a user name into the /etc/shutdown.allow file, remembering to explicitly include the root user as well
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
A. Clay Stephenson
Acclaimed Contributor

Re: create user able to shutdown the system

You can create a user with UID = 0 amd make the shell /sbin/shutdown but I would not do this. I would much prefer to designate certain trained users the ability to shutdown the box via sudo.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: create user able to shutdown the system

Hi:

To add to Melvyn's response, you can replace the user's default shell in '/etc/passwd' with '/sbin/shutdown'. Then, when the user logs in, the shutdown command is run.

Regards!

...JRF...
Stefan Schulz
Honored Contributor

Re: create user able to shutdown the system

Hi,

we once had such a user to allow the Worstation useres to shutdown their workstations.

The user named stop was a normal user, belonging to the group users. It was configured in /etc/shutdown.allow, which is necessary as mentioned above.

Also this user had his own homedirectory where the .profile did the shutdown. We did not use the /etc/shutdown as shell as the script .profile gave us the opportunity to do some extra stuff befor shutting down the system.

But take care if you use a script like we did. This is a potential security whole.

Hope this helps

Stefan
No Mouse found. System halted. Press Mousebutton to continue.
V. Nyga
Honored Contributor

Re: create user able to shutdown the system

Hi,

we changed shell-login to csh and added this at the end of the .login file:

cd /
/etc/shutdown -hy 0
logout

HTh
Volkmar
*** Say 'Thanks' with Kudos ***