Create user with option can shutdown HP-UX only (1084 Views)
Reply
Occasional Advisor
mardimarijo
Posts: 7
Registered: ‎04-03-2009
Message 1 of 20 (1,084 Views)

Create user with option can shutdown HP-UX only

Hi, i'm new to administration of HP-UX. I wan to create a user who able to shutdown the HP-UX machine but this user not have ability same as root. Please advise me. Thanks.
Honored Contributor
Hakki Aydin Ucar
Posts: 1,313
Registered: ‎08-16-2006
Message 2 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

/etc/shutdown.allow

it is good for you. put user you want him/her to allow to do that.
Honored Contributor
V. Nyga
Posts: 4,874
Registered: ‎09-20-2002
Message 3 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

Hi,

yes insert '+ ' in /etc/shutdown.allow.
You have to add root too, then ('+ root')

Volkmar
*** Say 'Thanks' with Kudos ***
Occasional Advisor
mardimarijo
Posts: 7
Registered: ‎04-03-2009
Message 4 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

Thanks to Hakki and Volkmar. 1 more question, why must have to add root too, then ('+ root'). Can give me example how to do it.

Thanks again.
Honored Contributor
V. Nyga
Posts: 4,874
Registered: ‎09-20-2002
Message 5 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

Hi again,

well, for my ws with 11.11, that's my experience.
As soon as you add one non-root user to /etc/shutdown.allow you're no longer allowed to shutdown as root.
So just add a second line.
This is my /etc/shutdown.allow:
+ stop
+ root

Just two lines ...

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Occasional Advisor
mardimarijo
Posts: 7
Registered: ‎04-03-2009
Message 6 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

Hi Volkmar,

Thanks for your advise.
Refer to your advise :
This is my /etc/shutdown.allow:
+ stop
+ root

what it mean + stop? this stop is username? I refer to your replied before, insert '+ ' in /etc/shutdown.allow.

Mardi
Honored Contributor
V. Nyga
Posts: 4,874
Registered: ‎09-20-2002
Message 7 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

yes - 'stop' is my second user, who can shutdown the ws.

Sorry, was not clear enough from my side.
Volkmar
*** Say 'Thanks' with Kudos ***
Occasional Advisor
mardimarijo
Posts: 7
Registered: ‎04-03-2009
Message 8 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

Thanks Volkmar.

Why i wan my staff to be able to shutdown as I most of time have to go outstation and want them to be able shutdown the machine but at the same time restrict them to perform job as administrator.

I will inform you when I try on next Monday(April, 6th 2009).
Honored Contributor
V. Nyga
Posts: 4,874
Registered: ‎09-20-2002
Message 9 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

That was my intention, too. :-)

But I don't tell them the command, they just have to login as user 'stop'.
In his profile is the shutdown-command, so the ws is shutting down immediatelly.

Volkmar
*** Say 'Thanks' with Kudos ***
Occasional Advisor
mardimarijo
Posts: 7
Registered: ‎04-03-2009
Message 10 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

Hi Volkmar,

I already edited my shutdown.allow and add 2 line like below:

+ rose
+ root

and saved it. When i login using username rose and try to shutdown using this command:

shutdown -ry 0

this appear:

sh: shutdown: not found.

Can advise me.

Mardi
Acclaimed Contributor
Dennis Handly
Posts: 25,091
Registered: ‎03-06-2006
Message 11 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

sh: shutdown: not found.

If rose isn't a root user, she needs to use absolute paths to shutdown:
/sbin/shutdown -ry 0

The man page mentions the path:
http://docs.hp.com/en/B2355-60130/shutdown.1M.html
Occasional Advisor
mardimarijo
Posts: 7
Registered: ‎04-03-2009
Message 12 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

Thanks you Dennis.

I try like this:

Login as rose. then cd to /sbin then from that directory I can execute the shutdown -ry 0.

Is there a way i can modify so the user(in this example, rose) no need to change directory before execute the shutdwon command? Like what root can do.
Honored Contributor
Suraj K Sankari
Posts: 1,659
Registered: ‎09-09-2008
Message 13 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

HI,

>>Is there a way i can modify so the user(in this example, rose) no need to change directory before execute the shutdwon command? Like what root can do.

Just modify rose's .profile and add this line
PATH=$PATH:/sbin
export $PATH

Suraj
Acclaimed Contributor
Dennis Handly
Posts: 25,091
Registered: ‎03-06-2006
Message 14 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

>Login as rose. then cd to /sbin then from that directory I can execute the shutdown -ry 0.

If your home directory isn't on the root volume, you'll have to cd anyway.

>Is there a way I can modify so the user no need to change directory before execute the shutdown command?

You can update PATH as Suraj said. But you shouldn't be using that command that often to really save that much over using the absolute path.
Occasional Advisor
mardimarijo
Posts: 7
Registered: ‎04-03-2009
Message 15 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

Suraj and Dennis,

I think with add user in shutdown.allow is enough for the user to shutdown the after cd to /sbin.

I will try it at real server after office hour and let u all know tommorow.

Mardi
Honored Contributor
Suraj K Sankari
Posts: 1,659
Registered: ‎09-09-2008
Message 16 of 20 (1,084 Views)

Re: Create user with option can shutdown HP-UX only

Hi,

Please assign some points who give there valuable time for your problem.

To know how to assign points please go through the below link.


http://forums13.itrc.hp.com/service/forums/helptips.do?#33

Suraj
Advisor
expertone
Posts: 28
Registered: ‎03-11-2013
Message 17 of 20 (1,062 Views)

Re: Create user with option can shutdown HP-UX only

Suppose  two hosts mumbe1 and mumbe2... and now I want on that user "ASHISH" can shutdown the both the hosts.

 

So what will be the steps...

 

1 vi /etc/shutdown.allow

2 + ASHISH  mumbe1 mumbe2

3 wq!

 

 

so is these steps are ok ... or if there are any changes please revert me back as soon as possible.

Acclaimed Contributor
Dennis Handly
Posts: 25,091
Registered: ‎03-06-2006
Message 18 of 20 (1,058 Views)

Re: Create user with option can shutdown HP-UX only

>Suppose  two hosts mumbe1 and mumbe2

 

Then you need to have:

+ root

mumbe1 ASHISH

mumbe2 ASHISH

 

Note: This file must be present on both systems.

 

Advisor
expertone
Posts: 28
Registered: ‎03-11-2013
Message 19 of 20 (1,053 Views)

How to restrict FTP users

Can give you details about how to restrict certain FTP users .

Acclaimed Contributor
Dennis Handly
Posts: 25,091
Registered: ‎03-06-2006
Message 20 of 20 (1,050 Views)

Re: How to restrict FTP users

[ Edited ]

See the manpages for ftpaccess(4) and ftphosts(4).

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.