From owner-freebsd-questions Fri Nov 16 2:10: 9 2001 Delivered-To: freebsd-questions@freebsd.org Received: from falcon.prod.itd.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id AA28C37B405 for ; Fri, 16 Nov 2001 02:10:03 -0800 (PST) Received: from dialup-209.244.107.134.dial1.sanjose1.level3.net ([209.244.107.134] helo=blossom.cjclark.org) by falcon.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 164fwS-0007Ih-00; Fri, 16 Nov 2001 02:09:53 -0800 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id fAGA8oD49341; Fri, 16 Nov 2001 02:08:50 -0800 (PST) (envelope-from cjc) Date: Fri, 16 Nov 2001 02:08:50 -0800 From: "Crist J. Clark" To: yura Cc: freebsd-questions@FreeBSD.ORG Subject: Re: su and passwd Message-ID: <20011116020850.G9851@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <200110250858.f9P8wK721582@monkey.sunet.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200110250858.f9P8wK721582@monkey.sunet.ru>; from yura@monkey.sunet.ru on Thu, Oct 25, 2001 at 12:58:20PM +0400 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Oct 25, 2001 at 12:58:20PM +0400, yura wrote: > There is a question. Why such thing doesn't work: > (logged on as root) > $ su - myuser > $ passwd > passwd: permission denied > > If someone can answer that, I'd be much grateful. Because passwd(1) uses getlogin(2) to identify the current user. If you had really logged in as root (and not su'ed to root), what you did above is the same as, $ passwd root Which, as we would hope, fails. Doing a, $ passwd myuser Should work fine however. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message