Use o seguinte comando, substituindo /bin/sh
pelo seu shell preferido:
SHELL=/bin/sh sudo -s
Este comando define primeiro a variável de ambiente SHELL
temporariamente para /bin/sh
ou o shell que você escolheu. Em seguida, ele invoca sudo -s
, que faz o login no shell definido pela variável SHELL
.
Veja o log de terminal de exemplo. Observe a ps
output que exibe bash
(meu shell padrão) e uma vez sh
como segundo processo na hierarquia, bem como os diferentes prompts.
$ sudo -s
root: ~ # ps
PID TTY TIME CMD
23103 pts/2 00:00:00 sudo
23104 pts/2 00:00:00 bash
23146 pts/2 00:00:00 ps
root: ~ # exit
ipc-admin: ~ $ SHELL=/bin/sh sudo -s
# ps
PID TTY TIME CMD
23190 pts/2 00:00:00 sudo
23191 pts/2 00:00:00 sh
23200 pts/2 00:00:00 ps
# exit
$