【Ubuntu】「is not in the sudoers file. This incident will be reported. 」エラーの対応方法

Ubuntuで「is not in the sudoers file. This incident will be reported. 」エラーが出た場合の対応方法についてまとめました。

スポンサーリンク

「is not in the sudoers file. This incident will be reported. 」エラー

CentOSと違い、Ubuntuでsudoコマンドを実行すると、wheelユーザーグループがないため以下のエラーが出ました。

$ sudo XXXXX
[sudo] password for XXX:
vpn is not in the sudoers file.  This incident will be reported.

以下の手順でwheelユーザーグループを作成することでエラーが解消されました。

●「/etc/pam.d/su」に以下を追記します。

auth sufficient pam_wheel.so trust group=wheel

●「/etc/sudoers.tmp」に以下を追記します。

%wheel ALL=(ALL) NOPASSWD:ALL

● 以下のコマンドを実行し、wheelグループにユーザーを追加します。

$ sudo usermod -aG wheel vpn
sudo usermod -aG wheel my-user-name

● 再起動してsudoコマンドが使えることを確認します。

スポンサーリンク

関連記事

【Ubuntu】初心者向けに使い方を解説
Ubuntuの使い方を初心者向けに解説します。
【ConoHa VPS】LinuxOSサーバーを手軽に運用する方法
ConoHa VPSでLinuxOSサーバーを手軽に立てて運用する法についてまとめました。
Linux
スポンサーリンク

コメント