Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jan 2008 18:58:49 +0000
From:      Chris Whitehouse <cwhiteh@onetel.com>
To:        freebsd-questions@freebsd.org
Subject:   localhost in sudoers
Message-ID:  <47924869.2000909@onetel.com>

next in thread | raw e-mail | index | archive | help
Hi,

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
/root/testsudo: Permission denied.

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

%sudo /root/testsudo
hello

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

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

/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?

Thanks

Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47924869.2000909>