
Tentei acessar um sistema recém-instalado através do Tramp do Emacs da mesma forma que faço com todos os meus outros sistemas:
C-x C-f /ssh:server|sudo:root@server:/etc/network/interfaces
Este comando expirou. Depois de alguma investigação, descobri isso sudo
e dash
parece ser incompatível, embora o meu sudoers
seja bem simples:
# 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
Quando uso um shell normal como o Bash, o seguinte comando funciona bem:
env SHELL=/bin/bash sudo -u root -s -H
Mas quando eu uso o traço, ao qual /bin/sh está vinculado, o seguinte comando
env SHELL=/bin/sh sudo -u root -s -H
gera um loop infinito
/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ó pode ser interrompido por kill -9
.
Eu gostaria de fazer, apt-get purge dash
mas o sistema operacional insiste em mantê-lo.
Como consertar isto?
Responder1
Eu fiz isso:
cd /bin
rm sh
ln -s bash sh
apt-get purge dash
apt-mark hold dash
A máquina ainda está inicializando.