"visudo -x"オプションを使用した後、sudoはありません。

"visudo -x"オプションを使用した後、sudoはありません。

visudo構文エラーについて警告したため、変更せずに終了しました。私はその中に新しいファイルを作成することにしました/etc/sudoers.d。残念ながら、私はマンファイルの概要に十分注意を払わず、それを投稿しませんでしたsudo visudo -x /etc/sudoers.d/jupyter(正しい引数では-fないはずです-x)。新しいファイルを作成するのではなく、私の設定をエクスポートしました。最終結果は次のとおりです。もはやsudoは必要ありません

  1. リカバリモードで再起動しなくてもリカバリできますか?
    • この方法私には適していません(ノーチラスを使用)
  2. またvisudo、これはうまくいくべきですか? (斜めではありませんが、意図された目的はユーザーを保護することです。そうですか?)ところで、どうしても輸出対象が適切かどうかは確認しないようですね。

Debian 8(32ビット)の使用

>>> /etc/sudoers.d/jupyter: syntax error near line 1 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 1 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 2 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 2 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 3 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 4 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 4 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 4 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 4 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 5 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 6 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 6 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 6 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 6 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 7 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 8 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 8 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 8 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 8 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 9 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 9 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 10 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 11 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 11 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 12 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 13 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 13 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 14 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 14 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 15 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 16 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 16 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 17 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 18 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 18 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 19 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 20 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 20 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 21 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 22 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 22 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 22 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 22 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 22 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 22 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 23 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 24 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 24 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 25 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 26 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 26 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 27 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 27 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 28 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 29 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 29 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 30 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 31 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 31 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 32 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 33 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 33 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 34 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 35 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 35 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 35 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 35 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 35 <<<
>>> /etc/sudoers.d/jupyter: syntax error near line 35 <<<
sudo: parse error in /etc/sudoers.d/jupyter near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

答え1

ルートパスワードを知っている場合は、次のことができます。

$ su root
# rm /etc/sudoers.d/jupyter

visudosudoファイルを確認してくださいもし編集モードでは、エクスポートモードで実行します。

関連情報