FreeBSD modified CSH for bash root failed to login solution

Source: Internet
Author: User

FreeBSD in order to determine whether a process exists, the implementation of the Chsh-s/bin/bash command, unfortunately, is just disconnected, and then again link can not be able to su root in the administrative authority. Sad thing, had to ask the room to help operate.

The code is as follows Copy Code

Chsh-s/bin/bash
View/etc/passwd content when found

Root:*:0:0:charlie &:/root:/bin/bash
This sentence has been changed
Turns out to be
Root:*:0:0:charlie &:/root:/bin/csh

viewing/etc/passwd with cat commands

The code is as follows Copy Code

kiccleaf# cat/etc/passwd
# $FreeBSD: src/etc/master.passwd,v 1.40.22.2.2.1 2012/03/03 06:15:13 kensmith EXP $
#
Root:*:0:0:charlie &:/root:/bin/bash
The original content is:

kiccleaf# cat/etc/passwd
# $FreeBSD: src/etc/master.passwd,v 1.40.22.2.2.1 2012/03/03 06:15:13 kensmith EXP $
#
Root:*:0:0:charlie &:/root:/bin/csh

As a result FreeBSD's/bin/directory does not have bash this command exists, so log on as error message:

Login:/bin/bash:no such file or directory
The root shell has been changed to bash, causing the system to go, and can be resolved in several ways:

When the system starts, choose "4", enter "Single-user" mode, enter "Boot-s" into the single user's prompt "#", type the following command:

The code is as follows Copy Code
Fsck-p
Mount-u/
Mount-a-T UFS
Swapon-a
Chsh-s/bin/csh

Then restart the system so that you can log on to the root admin account again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.