On Wed, Feb 27, 2008 at 11:24 PM, Lesley B <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I'm updating an OpenBSD box on my lan and changed passwords over ssh.
>
> I successfully changed the normal users but, having su'd to root, could not
> then change the root password over ssh.
> I got prompted for the new password twice, as normal, and there were no
> error messages and there was nothing apparent to say
> the action didn't work.
>
> However when I exited and re-su'd it wouldn't accept the new password but
> would accept the old.
>
> I'm using the local passwd system and I have root login disabled over ssh.
>
> Is this a security feature when su'ing to change root passwd or is it caused
> by trying to change it over ssh?
>

passwd changes the password for $USER.
su(1) does not change $USER. It will launch a shell with the
permissions of root (or some other specified user) but it does not
modify environment variables.
So what you've done is changed your regular user password by accident.
The solution is to always use passwd(1) with the user argument just to
be safe, like this:
$ su
# passwd root
Old password: ...
New password: ...
Again: ....
# ^D

Hope that helps
-Nick
_______________________________________________
Openbsd-newbies mailing list
[email protected]
http://mailman.theapt.org/listinfo/openbsd-newbies

Reply via email to