Date: Mon, 15 Feb 1999 16:09:58 +1030 From: Greg Lehey <grog@lemis.com> To: Thomas Bentz <adoy@concentric.net>, questions@FreeBSD.ORG Subject: Re: Root password Message-ID: <19990215160958.B2207@lemis.com> In-Reply-To: <36C7AE11.2645FA09@concentric.net>; from Thomas Bentz on Sun, Feb 14, 1999 at 09:18:09PM -0800 References: <36C7AE11.2645FA09@concentric.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990215160958.B2207>