After the upgrade 11.1 to 11.2 I can log in as root

I upgraded consistently from 11.0 to 11.1 to 11.2. But after this I can not go in as a root to do freebsd-update install
Code:
Shared object "libdl.so.1" not found, required by "bash"
Therefore, I got version 11.1-RELEASE-p15 and the kernel is loaded 11..2-RELEASE-p7 (GENERIC). What should I do to return the rights of the root
 
if you cannot compile bash as a static binary, then its probably prudent to have a working toor account with the default shell, incase the root shell breaks.

The fix now is probably to boot into rescue OS and change the config so the root account isnt using bash which will then allow you to login again.
 
if you cannot compile bash as a static binary, then its probably prudent to have a working toor account with the default shell, incase the root shell breaks.

The fix now is probably to boot into rescue OS and change the config so the root account isnt using bash which will then allow you to login again.
Code:
-sh:toor:not found
 
And this is why you shouldn't change root's shell. Boot to single user mode and change root's shell back to csh(1).
 
This is how you get to Single User Mode:

Code:
fsck -y
mount -u /
mount -a -t ufs
swapon -a

Then edit your file using ee (Easy Editor).
 
That's your current shell. Which you probably gave when you booted to single user mode. Use chsh(1) to change root's shell back to csh(1).

While still in single user mode, finish the freebsd-update install. Then upgrade/update all your packages/ports. Not strictly required but it's going to fix a bunch of broken dependencies.
 
You have all the commands you need in the link I provided. Since you have to mount your file system in read/write, it depends what fs you use. Just read carefully and you will recover your shell.
 
Understood, in a single mode i need in /etc/passwd write ...../root: /bin/csh ?

I had there /usr/local/bin/bash
 
That's your current shell. Which you probably gave when you booted to single user mode. Use chsh(1) to change root's shell back to csh(1).

While still in single user mode, finish the freebsd-update install. Then upgrade/update all your packages/ports. Not strictly required but it's going to fix a bunch of broken dependencies.
in single user mode when I do freebsd-update install the same error appears
Shared object "libdl.so.1" not found, required by "bash"
 
FreeBSD's freebsd-update(8) doesn't use Bash, at all. So you modified other things too. Did you replace /bin/sh with Bash? That's a really bad idea.
 
Just installing shells/bash is not a problem. Replacing FreeBSD's /bin/sh with bash is. Do NOT do things like that, ever. There's absolutely no reason for it and it will break normal system scripts. As you already found out.
 
This is how you get to Single User Mode:

Code:
fsck -y
mount -u /
mount -a -t ufs
swapon -a

Then edit your file using ee (Easy Editor).
Thanks. I changed root in /etc/passwd to
Code:
root:*:0:0:Charlie &:/root:/bin/csh
But again when trying to log in as root
Code:
Shared object "libdl.so.1" not found, required by "bash"
 
This is how you get to Single User Mode:

Code:
fsck -y
mount -u /
mount -a -t ufs
swapon -a

Then edit your file using ee (Easy Editor).
I read that /etc/passwd is not edited using ee but using vipw. Maybe this is the problem
While if you use a third-party editor instead of "vipw" and "pw", you need
edit both / etc / passwd and /etc/master.passwd, and then run pwd_mkdb
 
Problem solved. Here's how to do it right:
1. single-user mode
2. fsck_ffs -y /
3. mount -u -w /
4. vipw change /usr/local/bin/bash to /bin/csh
5.reboot
Thanks to all
 
I read that /etc/passwd is not edited using ee but using vipw. Maybe this is the problem
While if you use a third-party editor instead of "vipw" and "pw", you need
edit both / etc / passwd and /etc/master.passwd, and then run pwd_mkdb

I've got all my 3rd party programs installed and already hit the desktop by the time I edit /etc/passwd so I use editors/leafpad. I can do the same thing with ee or editors/vim but am a lot faster with Leafpad and use it as my default text editor.
 
Never edit /etc/passwd with a "plain" editor. Use vipw(8) (it respects the EDITOR variable so you can change the actual editor that's used), chsh(1) or the pw(8) commands to manipulate it. The reason is that the passwd file is never actually used, it's only there for historical reasons. The actual user database is stored in /etc/master.passwd. These tools will make sure both files are kept in sync while a "plain" editor would not.
 
As always, you are correct, Sir. I checked /etc/master.passwd and the toor line was still there. :)
 
This is probably the textbook example why not to change root's shell. But I understand why users do want to have different shell than csh. I myself don't like csh. I really tried and no, I don't want it. (I'm used to ksh on HPUX, or bash on Linux, and nowadays on Solaris too).

There are few implications when changing root's shell. As you have found out there can be issues with lib dependencies which are not shipped with FreeBSD. Depending on your setup there can also be a problem when booting to single mode and /usr not being mounted (when bash is in /usr/local/bin).

To avoid issues with lib dependency I suggest you to use bash-static. Either use one from pkg:

pkg install bash-static

or compile bash from ports and select option STATIC from the menu. You can verify that by

Code:
cd /usr/ports/shells/bash
make config
And make sure STATIC option is selected. Remove current bash (either by pkg delete bash or make uninstall in port's directory) and compile new one.

Of course, as mentioned by SirDice, never ever change /bin/sh to anything else.
 
Back
Top