1833043 Members
2482 Online
110049 Solutions
New Discussion

Shutdown to User

 
SOLVED
Go to solution
Daniel Duarte
Frequent Advisor

Shutdown to User

How can I, configure specific shutdown USER, HP-UX 10.20.

Thanks
10 REPLIES 10
Patrick Wallek
Honored Contributor

Re: Shutdown to User

Set up your user and then add that user to the /etc/shutdown.allow file (you should also add root to that file).

RAC_1
Honored Contributor

Re: Shutdown to User

You mean allow user to shutdown a machine??

You can use /etc/shutdown.allow file. man 1m shutdown for details.

You can slao install sudo and configure it for your requirement.
There is no substitute to HARDWORK
Pete Randall
Outstanding Contributor
Solution

Re: Shutdown to User

Or you can set up restricted SAM access for the user and they can shutdown that way.

sam -r


Pete

Pete
Daniel Duarte
Frequent Advisor

Re: Shutdown to User

I have used this workaround and doesn't work.

# more /etc/shutdown.allow
user

#

Any tips ?

Sundar_7
Honored Contributor

Re: Shutdown to User

What do you mean when you say it doesnt work ?

After adding entries to the /etc/shutdown.allow file, did you try /usr/sbin/shutdown -r -y 0 command by logging in as that user ?

Remember you cannot issue shutdown from a mounted filesystem

$ cd /; /usr/sbin/shutdown -r -y 0
Learn What to do ,How to do and more importantly When to do ?
Daniel Duarte
Frequent Advisor

Re: Shutdown to User

The command used.

$ /usr/sbin/shutdown -r -y 0
User add021 not allowed to shutdown this system (bzhp103) -- exiting shutdown.
$ pwd
/
$ more /etc/shutdown.allow
add021
$

Pete Randall
Outstanding Contributor

Re: Shutdown to User

Daniel,

You need to put the server name in the shutdown.allow file like this:



ie

myserver add021



Pete

Pete
Sanjay_6
Honored Contributor

Re: Shutdown to User

Hi,

also make sure that the world has execute permission for /sbin/shutdown. The permissions could be 4555 and could read as -r-sr-xr-x

Hope this helps.

Regds
Daniel Duarte
Frequent Advisor

Re: Shutdown to User

Thank you and regards, it worked !!!!! :)


Bill Hassell
Honored Contributor

Re: Shutdown to User

From the man page for shutdown(1m):

"The file contains lines that consist of a system host name and the login name."

So your shutdown.allow file must have the system name too:

mycpu add021


Bill Hassell, sysadmin