sudo コマンドをdebianにインストールする

インストール

apt-get -y install sudo

スーパーユーザで/etc/sudoersを編集

# visudo

権限について

mackxxx  ALL=(ALL:ALL) ALL

sudoコマンドを入れた際のパスワードを省略する設定をします。

mackxxx    ALL=NOPASSWD: /sbin/shutdown
mackxxx   ALL=NOPASSWD: /sbin/reboot

最終的な/etc/sudoers

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL
mackxxx  ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL
mackxxx    ALL=NOPASSWD: /sbin/shutdown
mackxxx    ALL=NOPASSWD: /sbin/reboot

# See sudoers(5) for more information on "#include" directives: