Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jan 2008 18:58:49 +0000
From:      Chris Whitehouse <>
Subject:   localhost in sudoers
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help

If I put my computers ip address in sudoers a command runs successfully. 
  If I put localhost I am prompted for a password.

Check I can't run it normally:
/root/testsudo: Permission denied.

Entry in sudoers:

%sudo /root/testsudo

Entry in sudoers:
chrisw  localhost=NOPASSWD:/root/testsudo

%sudo /root/testsudo
chrisw is not allowed to run sudo on eco.  This incident will be reported.
%ping localhost
PING localhost ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=0.034 ms
64 bytes from icmp_seq=1 ttl=64 time=0.021 ms

/var/log/messages says 'user NOT authorized on host'

The problem is this machine gets its ip address by dhcp so I shouldn't 
enter an ip in sudoers. Is there a neat way round this?



Want to link to this message? Use this URL: <>