私は多くのブログ投稿を見てきました、それで十分です
aptitude install sudo
su root
adduser USERNAME sudo
しかし、これはを保護するだけです。aptitudeつまり、
- aptitude install sendmailパスワードを要求します。実行する必要があり- sudoます- aptitude
- apt-get install sendmailパスワードを要求しないので、- sudo特権は必要ありません
- 保護されたファイルを編集する場合、 - etcその中のファイルはパスワードを要求しないので、- sudo特権は必要ありません
- のようなサービスを実行および停止でき - apacheます。パスワードを要求することはなく、- sudo特権は必要ありません。
これを修正するには?これは私のsudoersファイルです:
 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:$
# Host alias specification
# User alias specification
# Cmnd alias specification
これは次の出力ですsudo -l。
Matching Defaults entries for root on this host:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User root may run the following commands on this host:
    (ALL : ALL) ALL
    (ALL : ALL) ALL
su root、rootユーザーとしてログインしているため、すべてに完全にアクセスできます。sudo特権操作に使用する必要がある通常の使用に戻るには、として実行しているシェルからログアウトしrootます。