Operating System - HP-UX
1834458 Members
2613 Online
110067 Solutions
New Discussion

How to give root access to a user

 
SOLVED
Go to solution
OldSchool
Honored Contributor

Re: How to give root access to a user

"# sudo 1.6.9p17 sudo
sudo.sudo-RUN"

Can't tell from the info posted, but it appears he's got it installed and in his path....

not sure *what* the listing of /etc was supposed to tell us, other that the sudoers file isn't present.
Ivan Krastev
Honored Contributor

Re: How to give root access to a user

Use find to locate visudo and sudo binaries.

For sam use:
#sam -r

regards,
ivan
OldSchool
Honored Contributor

Re: How to give root access to a user

disregard my previous, it isn't in your path. it should be in /usr/local/bin, if not, instructions on finding it are posted above. fix your PATH variables as required.

Ivan gave you instructions on configuring user "grayh". substitute "sam" for "grayh".


Grayh
Trusted Contributor

Re: How to give root access to a user

# visudo
sh: visudo: not found.
# sudo
sh: sudo: not found.
# man sudo
No manual entry for sudo.
# swlist | grep sudo
sudo 1.6.9p17 sudo

I am not able to do visudo... it pops out with an error
Grayh
Trusted Contributor

Re: How to give root access to a user

# whereis visudo
visudo: /usr/local/sbin/visudo /usr/local/share/man/man1m/visudo.1m
Grayh
Trusted Contributor

Re: How to give root access to a user

looks like sudo dosent my my system...

Could someone give me an example with the user " test " to have root privelages with HP's RABC... when both serve the same perpose.. why are we struggling with sudo..

Can someone give me an expmaple with one user of any name ex "user1"

where i have a user called user1
# roleadm add user1
roleadm: added role user1

#roleadm assign user1 Administrator
roleadm assign done in /etc/rbac/user_role

#roleadm list
root: Administrator
user1: Administrator

Now how can I configure there roles using authadmin... So that the user called "user1" can have root privileges...


plz do not point me to the below link

http://docs.hp.com/en/5992-2395/5992-2395.pdf
OldSchool
Honored Contributor

Re: How to give root access to a user

"looks like sudo dosent my my system... "

then I guess you didn't install it like you said you did, or that the installation failed.

"Could someone give me an example with the user " test " to have root privelages with HP's RABC... when both serve the same perpose.. why are we struggling with sudo.. "

The only one struggling with sudo appears to be you...
and you started with rbac... then switched trying sudo....

As noted previously, this discusses how to configure the roles and users in RBAC, and gives specific examples:

http://docs.hp.com/en/5991-8678/ch03s05.html?jumpid=reg_R1002_USE
OldSchool
Honored Contributor

Re: How to give root access to a user

then of course, you could have followed what James told you on how to use "find" to locate "sudo" on your system......
Grayh
Trusted Contributor

Re: How to give root access to a user

# find / -name "sudo*"
/tmp/sudo-1.6.9p17-ia64-11.23.depot
/usr/local/bin/sudo
/usr/local/bin/sudoedit
/usr/local/etc/sudoers.sample
/usr/local/etc/sudoers
/usr/local/doc/sudo
/usr/local/libexec/sudo_noexec.so
/usr/local/share/man/man1m/sudo.1m
/usr/local/share/man/man1m/sudoedit.1m
/usr/local/share/man/man4/sudoers.4
/var/adm/sw/products/sudo
/var/adm/sw/products/sudo/sudo-RUN
James R. Ferguson
Acclaimed Contributor

Re: How to give root access to a user

Hi (again):

So the 'find' I suggested found your 'sudo' installed in '/usr/local' as the documentation at the Porting Center would have told you...

NOW, do you have '/usr/local' in your PATH ? I would hope you don't since that, for root, is a security weakness. Run with an absolute path.

Regards!

...JRF...
OldSchool
Honored Contributor

Re: How to give root access to a user

ok, so it is installed, and the executable is in "/usr/local/bin". and "/usr/local/bin" is not part of the PATH, so typing "sudo" doesn't work....

fix the path and sudo will work...and the setup is described earlier in this thread by Ivan.

Or continue with RBAC and read the docs.

But choose a direction and run with it.
OldSchool
Honored Contributor

Re: How to give root access to a user

james last suggestion about the absolute path is a valid concern.

/usr/local/bin/sudo
/usr/local/bin/visudo should both work.

the manpages for it probably aren't in your MANPATH if you can't get them to come up using "man sudo"

they are available for review on the internet however.
Grayh
Trusted Contributor

Re: How to give root access to a user

# /usr/local/bin/visudo
sh: /usr/local/bin/visudo: not found.
# /usr/local/bin/sudo
sudo: /usr/local/etc/sudoers is zero length
# Oct 7 15:03:45 MAHP05 sudo: root : /usr/local/etc/sudoers is zero length
; TTY=pts/ta ; PWD=/tmp ; USER=root ; COMMAND=/sbin/sh

this is again troubling me with zero length

# ll /usr/local/bin/
total 1664
---s--x--x 2 root root 419684 Jun 30 13:04 sudo
---s--x--x 2 root root 419684 Jun 30 13:04 sudoedit
Grayh
Trusted Contributor

Re: How to give root access to a user

the other guys are waiting from my end to give the box to them to install Oracle
OldSchool
Honored Contributor

Re: How to give root access to a user

ok, instead of visudo, run

/usr/local/bin/sudoedit /etc/sudoers

and add the information as noted by Ivan. you can substitute any valid login name for "grayh" in his example...

OldSchool
Honored Contributor

Re: How to give root access to a user

the zero length is because the /etc/sudoers file does not yet exist.

if you refer back to the listing produced by find, you will see a sample that can be used as a base...

also the man pages are there as well.
Grayh
Trusted Contributor

Re: How to give root access to a user

# /usr/local/bin/sudoedit /etc/sudoers
sudoedit: /usr/local/etc/sudoers is zero length
# Oct 7 15:27:33 MAHP05 sudo: root : /usr/local/etc/sudoers is zero length
; TTY=pts/ta ; PWD=/tmp ; USER=root ; COMMAND=sudoedit /etc/sudoers

and man pages are not working
OldSchool
Honored Contributor

Re: How to give root access to a user

# find / -name "sudo*"
/tmp/sudo-1.6.9p17-ia64-11.23.depot
/usr/local/bin/sudo
/usr/local/bin/sudoedit
/usr/local/etc/sudoers.sample
/usr/local/etc/sudoers
/usr/local/doc/sudo
/usr/local/libexec/sudo_noexec.so
/usr/local/share/man/man1m/sudo.1m
/usr/local/share/man/man1m/sudoedit.1m
/usr/local/share/man/man4/sudoers.4
/var/adm/sw/products/sudo
/var/adm/sw/products/sudo/sudo-RUN

install the man pages somewhere in manpath, or fix the manpath to add the one above

run the find again to locate visudo

Dennis Handly
Acclaimed Contributor

Re: How to give root access to a user

>OldSchool: /usr/local/share/man/man1m/sudo.1m
>or fix the manpath to add the one above

You can also use -M:
man -M /usr/local/share/man sudo
Grayh
Trusted Contributor

Re: How to give root access to a user

# cd /usr/local/etc
# ls
sudoers sudoers.sample
# ll
total 16
-r--r----- 1 root sys 0 Oct 7 13:30 sudoers
-r--r----- 1 root root 715 Jun 30 13:04 sudoers.sample

this sudoers is empty.....

is it always like that...
Grayh
Trusted Contributor

Re: How to give root access to a user

I was trying to read the man pages and still some confusion somewhere ... Could you gurus help me to resolve this issue..

I can provide the o/p of all the logs you would require for this
OldSchool
Honored Contributor

Re: How to give root access to a user

1.So...copy sudoers.sample to sudoers.

2. cd to / and run "find . -name visudo" to locate the editor

3. follow Ivan's instructions above
killer1
Advisor

Re: How to give root access to a user

Hi There

Please edit the file "/usr/local/etc/sudoers " using "vi" and add each users in following format.


vi /usr/local/etc/sudoers

#Username Permissions
gravh ALL=ALL

Regards
Grayh
Trusted Contributor

Re: How to give root access to a user

Thanks Oldschool... looks like things are moving a bit now..

I have done that..

copied and then find the file which gave the following location

./usr/local/etc/sudoers.tmp

and then added the follwoing lines to it

jack ALL=(ALL)PASSWD:ALL
danial ALL=(ALL)PASSWD:ALL
udmag ALL=(ALL)PASSWD:ALL
parinta ALL=(ALL)PASSWD:ALL

wq!

And then I logged in as a user and exectuetd the following

$ sudo -su
sh: sudo: not found.
$ useradd asdf
sh: useradd: not found.
$

What else should I do
Grayh
Trusted Contributor

Re: How to give root access to a user

you all have helped me till now... 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