I read the answers on those questions (this && this), neither of them work for me!% uname --operating-system --kernel-name --kernel-version --kernel-release Linux 4.9.6-200.fc25.x86_64 #1 SMP Thu Jan 26 10:17:45 UTC 2017 GNU/LinuxI download/install st terminal (simple terminal), and I would like to set it as my main terminal-emulator, but I did a huge mistake, which is running this command as root: % su -c 'chsh -s /usr/local/bin/st'. Now, whenever I want to login/run a command as root, a message is printed: Can't open display. I tried the following commands (as shown below), but non of them work..% env -i bash% suPassword:Can't open display% su -c 'env -i bash'Password:Can't open display% su -c 'chsh -s /usr/bin/bash'Password:Can't open display% su -s bashPassword: su: using restricted shell /usr/local/bin/stCan't open display% suPassword:Couldn't read from shell: Input/output errorchild finished with error '256'% UPDATE:I tried to do as explained in the proposed answerFrom the bootloader prompt, navigate to the regular entry you boot from.Instead of pressing Enter press e to first edit the kernel command line parametersIn the editor that opens, use the arrow keys to find the line that starts with linux, go to its end and append init=/bin/sh to it. This will replace your init system temporarily by your system's shell and since init is started by root, this will be a root shell.Press CTRL+X to boot the modified entryrun chsh again with the correct parametersBut when I did the step 4, I was faced with this screen!
reset $SHELL to it's default value
shell;root;accounts;system recovery