Operating System - HP-UX
1822145 Members
3947 Online
109640 Solutions
New Discussion юеВ

sudo: user not authorized on this host

 
frederick hannah
Super Advisor

sudo: user not authorized on this host

I get the above message attempting to execute sudo commands via a userid. The userid is a legitimate id on the host, the /etc/sudoers file contains the id and the appropiate commands. What am I doing wrong?
6 REPLIES 6
Oliver Stoklossa
Frequent Advisor

Re: sudo: user not authorized on this host

Hello Frederick ...

It's not kind to answer a question with a question, but which OS are you using ...

I had similar problems on Redhat Linux and there it was a problem with visudo (I opened the /etc/sudoers with the vi)
Another thing might be, if you are working with NIS (nsswitch.conf). Is there a remote login, or are you working locally ... If remote, does a ping or a traceroute on "hostname" work ...

Best regards
Oli
Steve Steel
Honored Contributor

Re: sudo: user not authorized on this host

Hi

The advice is good and the program not stupid.

1)Non printable inthe sudoers file

2)Bad name resolution


Try sudo -s or sudo -v to see what happens.

Copy the id from the passwd file and use it to grep on the sudoers file


Steve Steel
+

If you want truly to understand something, try to change it. (Kurt Lewin)
frederick hannah
Super Advisor

Re: sudo: user not authorized on this host

I am using 11.0. No matter what sudo argument I use, I get the "user not allowed to use sudo on this host" message.
Our site uses DNS and sudo works fine for the same id on another 11.0 server.
Perhaps these is some non-printable character(s) out there in the /etc/sudo file. If so, how could I find those characters? Also, I am using sudo 1.6.b2
Steve Steel
Honored Contributor

Re: sudo: user not authorized on this host

Hi

Try

vis file

od -c file


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
frederick hannah
Super Advisor

Re: sudo: user not authorized on this host

Still no go gentlemen. I appreciate your efforts.
Andrew Cowan
Honored Contributor

Re: sudo: user not authorized on this host

Perhaps a stupid question?

Are you using any group or host restrictions in your sudoers? If so check that the host is who it thinks it is, and that this user really is a member of the right groups:

1. Login as the user and run "id"
2. ping the hostname locally and remotely.
3. Use nslookup etc to confirm that you always get the same answers (this includes localhost).

Beyond this can you post your sudoers file and an output of "sudo -v"?