From owner-freebsd-questions Sun Feb 14 21:40:13 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA06113 for freebsd-questions-outgoing; Sun, 14 Feb 1999 21:40:13 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA06108 for ; Sun, 14 Feb 1999 21:40:10 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id QAA04097; Mon, 15 Feb 1999 16:10:03 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id QAA02346; Mon, 15 Feb 1999 16:09:58 +1030 (CST) Message-ID: <19990215160958.B2207@lemis.com> Date: Mon, 15 Feb 1999 16:09:58 +1030 From: Greg Lehey To: Thomas Bentz , questions@FreeBSD.ORG Subject: Re: Root password References: <36C7AE11.2645FA09@concentric.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <36C7AE11.2645FA09@concentric.net>; from Thomas Bentz on Sun, Feb 14, 1999 at 09:18:09PM -0800 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sunday, 14 February 1999 at 21:18:09 -0800, Thomas Bentz wrote: > Is there any way to change the root password without reinstalling the > OS? Thanks, Tom Now how would reinstalling the OS help you change the root password? In fact, how would reinstalling the OS help you with anything? Reinstalling the OS is Microsoft's answer to people who have problems they can't solve. It doesn't help, but it keeps people quiet for a while. To change your root password, log in as root and use the `passwd' program. Read the manual for more details. Forgotten your root password? Don't do that. But in that case you'll need to reboot in single user mode. From ``The Complete FreeBSD'': If you do manage to lose the root password, all may not be lost. Reboot the machine to single user mode (see page 191), and enter: # mount -u / mount root file system read/write # passwd root change the password for root Enter new password: Enter password again: # ^D enter ctrl-D to continue with startup Note that you should explicitly state the name root: in single user mode, the system doesn't have the concept of user IDs. Page 191 says: Single user mode ________________ Sometimes it's inconvenient that multiple users can access the system. For example, if you're repartitioning a disk, you don't want other people walking all over the disk while you're doing so. Even if you're the only user on the system, daemons may be doing things in the background. In order to avoid this problem, you can stop the boot process before most of the daemons have been started and enter single user mode. To do this, specify the -s flag at boot time: Boot: -s As soon as the device probes have been completed, the system startup will be interrupted, and you will be prompted for a shell. Always choose sh: some other shells, notably bash, get confused in single user mode. Only the root file system will be accessible, and it will be mounted read-only. The reason for this is that the file system may be damaged and require repair before you can write to it. If you do need to write to the root file system, you should first check the consistency of the file system with fsck (see the man page on page 679). For example, npx0 on motherboard npx0: INT 16 interface end of the probes (high intensity display) Enter pathname of shell or RETURN for sh: hit RETURN erase ^H, kill ^U, intr ^C # fsck -y /dev/rwd0a check the integrity of the root file system ** /dev/rwd0a ** Last Mounted on / ** Root file system ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 1064 files, 8190 used, 6913 free (61 frags, 1713 blocks, 0.4% fragmentation) # mount -u / remount root file system read/write # mount /usr mount any other file systems you need To leave single user mode and enter multi user mode, just enter CTRL-D: # umount /usr # ^D Skipping file system checks... (the rest of the boot sequence) Greg -- When replying to this message, please copy the original recipients. For more information, see http://www.lemis.com/questions.html See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message