1752801 Members
5364 Online
108789 Solutions
New Discussion юеВ

Re: sudo problem

 
SOLVED
Go to solution
DeafFrog
Valued Contributor

sudo problem

here's what /usr/local/etc/sudoers file for machine looks like :
Cmnd_Alias ADMINS=/usr/sbin/useradd
root ALL=NOPASSWD:ALL
%sysadmin ALL=NOPASSWD:ALL
%oper ALL=NOPASSWD:ALL
~
user1 root=NOPASSWD:ADMINS

But here's what i am getting ....
$ whoami
user1
$ /usr/sbin/useradd -g general -m user2
Permission Denied
....i have tried googling ...but not working.

FrogIsDeaf
21 REPLIES 21
Patrick Wallek
Honored Contributor

Re: sudo problem

You have to actually use the 'sudo' command in order to get permissions.

$ sudo /usr/sbin/useradd -g general -m user2
Avinash20
Honored Contributor

Re: sudo problem

You need to use sudo before /usr/bin/useradd
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: sudo problem

/opt/sudo/bin/sudo /usr/sbin/useradd [options]
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: sudo problem

Also refer to the following thread

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=997812

Please assign points to this threads !!
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
DeafFrog
Valued Contributor

Re: sudo problem

Thanks Patrick ,

$ /usr/local/bin/sudo /usr/sbin/useradd -g general -m user2

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:
Sorry, try again.
Password:
Sorry, try again.
Password:
..................and the passwd is correct.
FrogIsDeaf
Avinash20
Honored Contributor

Re: sudo problem

Try less than 8 char password
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Patrick Wallek
Honored Contributor

Re: sudo problem

What password are you using?

The password you use is the password of the ID you are logged in as. In this case the password of user1.
DeafFrog
Valued Contributor

Re: sudo problem

Thanks Avinash and Patrick ,

I ahve tried both the passwd , for uer1 and root .not the mesasage is
Last successful login for user1: Tue Mar 3 18:17:31 oman-4 2009
Last unsuccessful login for user1: Tue Mar 3 18:46:50 oman-4 2009 on pts/0
user1 is not allowed to run sudo on mwdev1. This incident will be reported.
.....the system is trusted.
FrogIsDeaf
Avinash20
Honored Contributor

Re: sudo problem

You have not defined the parameter in visudo correctly.
"Light travels faster than sound. That's why some people appear bright until you hear them speak."