Operating System - HP-UX
1834120 Members
2290 Online
110064 Solutions
New Discussion

How to give root access to a user

 
SOLVED
Go to solution
Patrick Wallek
Honored Contributor

Re: How to give root access to a user

$ sudo -su
sh: sudo: not found.

So give the full path to the sudo executable.

$ /usr/local/bin/sudo su -


Grayh
Trusted Contributor

Re: How to give root access to a user

$ /usr/local/bin/sudo su -
>>> sudoers file: syntax error, line 32 <<<
>>> sudoers file: syntax error, line 33 <<<
>>> sudoers file: syntax error, line 34 <<<
>>> sudoers file: syntax error, line 35 <<<
>>> sudoers file: syntax error, line 36 <<<
>>> sudoers file: syntax error, line 37 <<<
sudo: parse error in /usr/local/etc/sudoers near line 32
OldSchool
Honored Contributor

Re: How to give root access to a user

"Plz tell me what I have to do next to complete ... so that I can implement this on all of the 30 boxes we have"

Uhhh...

you just went thru the process, so repeat it on the other 30?

Patrick Wallek
Honored Contributor

Re: How to give root access to a user

OK, your sudoers file is screwed up.

Invoke:

# /usr/local/sbin/visudo

Then immediately try to quit out. visudo should warn you about errors in the file. visudo does validation of the file before exiting to make sure it will work.
OldSchool
Honored Contributor

Re: How to give root access to a user

$ /usr/local/bin/sudo su -
>>> sudoers file: syntax error, line 32 <<<
>>> sudoers file: syntax error, line 33 <<<
>>> sudoers file: syntax error, line 34 <<<
>>> sudoers file: syntax error, line 35 <<<
>>> sudoers file: syntax error, line 36 <<<
>>> sudoers file: syntax error, line 37 <<<
sudo: parse error in /usr/local/etc/sudoers near line 32

ok...my crystal ball can't see the whats on line 32 of your sudoers file...but its wrong somehow.

did you do the find for visudo or not?
Grayh
Trusted Contributor

Re: How to give root access to a user

yes I have figured it out but now.. I get something like this

$ /usr/local/bin/sudo su -

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

Password:
oracle is not in the sudoers file. This incident will be reported.
$ useradd asd
sh: useradd: not found.
Grayh
Trusted Contributor

Re: How to give root access to a user

Well I have figured out the above issue also..... Thanks guys for your support
Patrick Wallek
Honored Contributor

Re: How to give root access to a user

>>oracle is not in the sudoers file.

Well, I would think that would be pretty obvious, but apparently not.

You added other users to the sudoers file, but not oracle. Yet you are now trying to run sudo as the oracle user. That is not going to work.

Add oracle to sudoers and try again.

Also, why do you keep trying to do useradd after running sudo? It is erroring out, so you never become root. Thus useradd won't work.
Grayh
Trusted Contributor

Re: How to give root access to a user

thank you every one