1827706 Members
3035 Online
109967 Solutions
New Discussion

"Shutdown User" Creation

 
roobala
Frequent Advisor

"Shutdown User" Creation

Hi All,

I have a HPUX 11.00 running on B-2000 W/s.
I want to create a user, the moment he enter his user name and password in console (in CDE)
the system should shutdown automatically,

I tried putting the command "shutdown -hy 0" in $HOME/.profile as well as in $HOME/.dtprofile, but it didn't happen,
instead it is simply logging in to the system.

How this can be achieved?
Thanks in Advance,
8 REPLIES 8
T G Manikandan
Honored Contributor

Re: "Shutdown User" Creation

First the user should have the shutdown permissions.

YOu can add the user name in the /etc/shutdown.allow

Then you can give a
shutdown -h -y 0 in the user's .profile file.


Thanks
roobala
Frequent Advisor

Re: "Shutdown User" Creation

hi,

I have created a user with UID "0", so anyhow I don't need to put him in /etc/shutdown.allow right?

with UID "0" and shutdown command in $HOME/.profile, it didn't work,

anyother soln..?

Animesh Chakraborty
Honored Contributor

Re: "Shutdown User" Creation

For this user also u must make home directory as / (root)
Shutdown command won't work from any mounted file system/directory.
Did you take a backup?
roobala
Frequent Advisor

Re: "Shutdown User" Creation

thanks animesh,

So I will make the user's home directory in / file system, for example, User name "halt",
will make it as /halt as a home directory.
If I put the command in shutdown in /halt/.profile, will it halt when I login from CDE with the user name halt?

T G Manikandan
Honored Contributor

Re: "Shutdown User" Creation

Yes,that should work.


Christian Gebhardt
Honored Contributor

Re: "Shutdown User" Creation

You can give the User the shutdown-command as "loginshell"

# grep shutdown /etc/passwd

shutdown_user:*:0:3:shuting down the system,,,:/:/usr/sbin/shutdown -hy 0

Christian
Ravi_8
Honored Contributor

Re: "Shutdown User" Creation

Hi,

You can't issue shutdown command from mounted file system, it should be /

make the user(halt) home dir as /
never give up
Elif Gius
Valued Contributor

Re: "Shutdown User" Creation

Hi,
add the user to /etc/shutdown.allow
As Shell you can give him a script which he he has to execute!



xuser:*:999:999:User for Shutdown ,,:/home/xuser:/home/xuser/shutdown.sh