Operating System - HP-UX
1748211 Members
4751 Online
108759 Solutions
New Discussion юеВ

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

 
Dennis Handly
Acclaimed Contributor

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
mardimarijo
Occasional Advisor

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.
Suraj K Sankari
Honored Contributor

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
Dennis Handly
Acclaimed Contributor

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.
mardimarijo
Occasional Advisor

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
Suraj K Sankari
Honored Contributor

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
expertone
Advisor

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.

Dennis Handly
Acclaimed Contributor

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.

 

expertone
Advisor

How to restrict FTP users

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

Dennis Handly
Acclaimed Contributor

Re: How to restrict FTP users

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