11 月 9, 2008 • Posted in: サーバ構築

sudoの簡単設定

毎回rootパスワードを入力して、rootになるのもリスキーなのでsudoを設定。

# usermod -G wheel MY_USER_ID

で、自分をwheelグループに追加


# vi /etc/sudoers
で以下の「%wheel」の行の先頭の#を削除してを有効化

## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL

これで、rootになるときは、

$ sudo su -

で、自分のPWDを入力してrootになる。

root権限でのコマンド実行は、次のような感じ。

$ sudo ifconfig

Leave a Reply

You must be logged in to post a comment.