Date: Fri, 16 Nov 2001 02:08:50 -0800 From: "Crist J. Clark" <cristjc@earthlink.net> To: yura <yura@monkey.sunet.ru> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: su and passwd Message-ID: <20011116020850.G9851@blossom.cjclark.org> In-Reply-To: <200110250858.f9P8wK721582@monkey.sunet.ru>; from yura@monkey.sunet.ru on Thu, Oct 25, 2001 at 12:58:20PM %2B0400 References: <200110250858.f9P8wK721582@monkey.sunet.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011116020850.G9851>
