This is a discussion on how to disable dns lookups and sendmail in sudo? within the Linux Administration forums, part of the Linux Forums category; I wrote a TCP server that needs to call an external program with root access, so it does that with ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I wrote a TCP server that needs to call an external program with root
access, so it does that with sudo. Only one problem: sudo always does a DNS lookup on the remote host, and some hosts don't have a valid entry, and so it returns an error like this: failed with exit code 255 : /usr/bin/sudo: unable to lookup testbox via gethostbyname() sendmail: Cannot open localhost:25 Also in the syslog, it prints: Jul 26 11:06:37 testbox tcpsrv[1727]: 2004/07/26-11:06:37 CONNECT TCP Peer: "192.168.1.3:56549" Local: "192.168.1.104:3333" Jul 26 11:06:37 testbox sSMTP[1729]: Unable to connect to localhost:25 Jul 26 11:06:37 testbox sSMTP[1729]: Cannot open localhost:25 Also, I want to disable all email attempts by sudo (which I imagine will just go away if DNS lookups can be disabled). Here's my current /etc/sudoers files: # Host alias specification # User alias specification # Cmnd alias specification # Override builtin defaults Defaults !fqdn, !lecture, !mail_no_user # User privilege specification root ALL = (ALL) ALL %users ALL = NOPASSWD: /usr/local/bin/tcpadmin -- No crazy stuff in my email. ;-) |