1830939 Members
2740 Online
110017 Solutions
New Discussion

Need to create a sudo ID

 
SOLVED
Go to solution
Bunty....
Advisor

Need to create a sudo ID

Hi,
I need to create a sudo ID that will enable the one user (user name : oracle) to shutdown and startup the server.
That user (oracle) will need root level access for this, but I do not want to give them the root password and I will want this sudo account.

Please suggest what to do.?
Thanks Bunty
10 REPLIES 10
Rick Garland
Honored Contributor

Re: Need to create a sudo ID

oracle ALL=/usr/sbin/shutdown -r -y g0
oracle ALL=/usr/sbin/shutdown -h -y g0

Doing a shutdown with reboot and a shutdown with halt

Nothing needed for startup
Darrel Louis
Honored Contributor

Re: Need to create a sudo ID

Hi Bunty,

Create the lines as Rick suggested in your sudoers file.
But just curious, why should a DBA reboot the server?

GoodLuck

Darrel
Bunty....
Advisor

Re: Need to create a sudo ID

Hi,
I will be on vacation and during this period, they need to reboot the server.

so I want to create a sudo file.
how will i create this file for oracle user.

if oracle user gives this command from his prompt:
$oracle ALL=/usr/sbin/shutdown -h -y g0

will it shutdown the server,
how i will create a sudo file?

Patrick Wallek
Honored Contributor

Re: Need to create a sudo ID

Actually you don't really need sudo for this.

Add the user name to the /etc/shutdown.allow file. This will allow the specified user to use the shutdown command.
Jeff_Traigle
Honored Contributor

Re: Need to create a sudo ID

Couldn't you simply add them to /etc/shutdown.allow? According to shutdown(1M), shutdown checks to see if the user is listed for authorization to run the command.
--
Jeff Traigle
Rick Garland
Honored Contributor

Re: Need to create a sudo ID

Note:

If the shutdown -h -y g0 is used, this will halt the system. Can cycle the power to power up. Other option is to go into GSP or EFI and do a RS (reset) of the system - this way the disk drives do not power cycle and will continue to spin.

The shutdown -r -y g0 will reboot the box. Generally no interaction in required.
Bunty....
Advisor

Re: Need to create a sudo ID

hi,
we need to add a new CPU so we need to shutdown the server and after completion of this activity, we will need to boot.
Bunty....
Advisor

Re: Need to create a sudo ID

Please suggest.
is it sufficient to add the user name in /etc/shutdown.allow?

or i have to do something more?

Darrel Louis
Honored Contributor
Solution

Re: Need to create a sudo ID

Bunty,

Yes that is sufficient.
Do they know what to do?

Darrel
Jeff_Traigle
Honored Contributor

Re: Need to create a sudo ID

You should simply need to add the oracle user to /etc/shutdown.allow.
--
Jeff Traigle