LoginSignup
1
2

More than 5 years have passed since last update.

sudoコマンド

Last updated at Posted at 2016-03-13

普通ユーザがrootユーザ権限のコマンドを実行する
用法:sudo command
原理はどのユーザがroot権限コマンドを実行できるかをあるファイルで定義する。
/etc/sudoers

sudoersの最終行は##と書いてあるが、コメント行にならない。
以下のフォルダの下にすべてのファイルがincludeされる。
/etc/sudoers.d/

例:上記フォルダにファイルを一個作って、記述する。
centos ALL=(ALL) NOPASSWD:ALL
centosがrootユーザとしてコマンドを実行できる。

sudo su -コマンドにより、rootユーザに切り替える。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2