sudo con guión da mala sustitución

sudo con guión da mala sustitución

Intenté acceder a un sistema recién instalado a través de Tramp de Emacs de la misma manera que lo hago con todos mis otros sistemas:

C-x C-f /ssh:server|sudo:root@server:/etc/network/interfaces

Este comando expiró. Después de investigar un poco, descubrí que sudoparecen dashser incompatibles, aunque el mío sudoerses bastante simple:

# grep -P -v '^(#.*)?$' /etc/sudoers
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
root    ALL=(ALL:ALL) ALL
%sudo   ALL=(ALL:ALL) NOPASSWD: ALL

Cuando uso un shell normal como Bash, el siguiente comando funciona bien:

env SHELL=/bin/bash sudo -u root -s -H

Pero cuando uso el guión al que está vinculado /bin/sh, el siguiente comando

env SHELL=/bin/sh sudo -u root -s -H

genera un bucle sin fin

/bin/sh: 0: Bad substitution
/bin/sh: 0: Bad substitution
/bin/sh: 0: Bad substitution
/bin/sh: 0: Bad substitution
/bin/sh: 0: Bad substitution
...

que sólo puede ser detenido por kill -9.

Deseo hacerlo apt-get purge dashpero el sistema operativo insiste en conservarlo.

¿Cómo arreglar esto?

Respuesta1

Lo hice:

cd /bin
rm sh
ln -s bash sh
apt-get purge dash
apt-mark hold dash

La máquina todavía se está iniciando.

información relacionada