From owner-freebsd-questions@FreeBSD.ORG Sat Jan 19 18:58:51 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 742B516A418 for ; Sat, 19 Jan 2008 18:58:51 +0000 (UTC) (envelope-from cwhiteh@onetel.com) Received: from smtp1.bethere.co.uk (smtp1.betherenow.co.uk [87.194.0.68]) by mx1.freebsd.org (Postfix) with ESMTP id 57C9513C4D1 for ; Sat, 19 Jan 2008 18:58:51 +0000 (UTC) (envelope-from cwhiteh@onetel.com) Received: from [192.168.1.71] (87-194-3-32.bethere.co.uk [87.194.3.32]) by smtp1.bethere.co.uk (Postfix) with SMTP id 05D5B98007 for ; Sat, 19 Jan 2008 18:58:50 +0000 (GMT) Message-ID: <47924869.2000909@onetel.com> Date: Sat, 19 Jan 2008 18:58:49 +0000 From: Chris Whitehouse User-Agent: Thunderbird 2.0.0.9 (X11/20071228) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: localhost in sudoers X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jan 2008 18:58:51 -0000 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