On Thu, Feb 5, 2009 at 7:44 AM, Hannah Schroeter <han...@schlund.de> wrote: > Hi! > > On Thu, Feb 05, 2009 at 02:39:18PM +0100, Hannah Schroeter wrote: >>On Thu, Feb 05, 2009 at 07:27:56AM -0600, Phusion wrote: >>>I am looking for advice on how to reset the root password on an >>>OpenBSD system that has console set to insecure in /etc/ttys. I have >>>booted off the install CD and into the shell and mounted the / >>>partition read-write, but don't have access to vi to modify >>>/etc/master.passwd. I was thinking I could clear out the root password >>>and afterwards run pwd_mkdb. Let me know. Thanks. > >>If you mount the original / partition (like in mount /dev/wd0a /mnt), >>you can then mount /usr, /var, too (e.g. mount /dev/wd0d /mnt/usr, mount >>/dev/wd0e /mnt/var). Then you can chroot into your system: >>/mnt/usr/sbin/chroot /mnt /bin/ksh. Then you can setup the terminal >>(export TERM=pcvt25) and the editor (export EDITOR=/usr/bin/vi) and >>use vipw. > > Of course, after chroot you could also use the passwd command (passwd > root) to directly set a new password for root (and perhaps your own > user account if you've lost that password too). passwd doesn't ask the > old password if you use it as root. > > And then, perhaps setup sudo so you can get root from your user account... > > Kind regards, > > Hannah. >
This suggestion of using chroot worked great. Thanks for the help. Phusion