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.