Top/System/sudo

目次

sudo

設定

  1. 設定は、 visudo コマンドで実行する。/etc/sudosers は以下のような記載となっている。
    ------------------------------------------------------------------
    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # Please consider adding local content in /etc/sudoers.d/ instead of
    # directly modifying this file.
    #
    # See the man page for details on how to write a sudoers file.
    #
    Defaults       env_reset
    Defaults       mail_badpass
    Defaults       secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    
    # Host alias specification
    
    # User alias specification
    
    # Cmnd alias specification
    
    # User privilege specification
    root   ALL=(ALL:ALL) ALL
    
    # Allow members of group sudo to execute any command
    %sudo  ALL=(ALL:ALL) ALL
    
    # See sudoers(5) for more information on "#include" directives:
    
    #includedir /etc/sudoers.d
    ------------------------------------------------------------------
  2. ユーザに対する権限の設定を行う
    • 書式
      <user>   ALL=(ALL:ALL) ALL
    • 書式の内容
      fielddescription
      <user>sudo を実行可とするユーザのID。
      グループを設定する場合は "%"を先頭につける。
      tty3 のように tty も指定出来る。
      ALL=ホストに対する許可(普通は ALL でよい)
      (ALL)sudo されるユーザ名(ALL ならば全てのユーザ権限、つまり root 権限を使うことが出来る。
      指定したユーザ<changed>に切り替えたい場合は (<changed>) のように記載する)
      ALL利用出来るコマンドの制限(ALL は括弧で括ったユーザの使える全てのコマンドを利用出来る)
  3. 保存して終了する。

sudo のコマンドラインオプション


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2021-05-11 (火) 22:58:30