【私のlinux学習の道】sudoとsudoers


環境構成:実行環境、win 10;システムを実行し、CetnOS 6.7.
情景還元:練習問題をしています.テーマは以下の通りです.
次のコマンドを実行すると、パスワードを入力するプロンプトが表示されます.入力したパスワードはどのユーザーのパスワードですか.
             [test@oldboy~]$ sudo su - oldboy
検索资料を通じて(通って)su�userが指定のユーザーに切り替えて入力するパスワードがuserのパスワードであることを提示して、sudo su�userの现在のユーザーはrootの権限でsuコマンドを実行して、パスワードを出力して现在のユーザーのパスワードを死ぬことを提示して、その原因を究明して、sudo自身はsetuidプログラムで、机能の上でそれは直接rootの身分でいかなるコマンドを実行することができて、セキュリティを考慮すると、sudoを実行する人にはパスワードが必要です.sudoのプロファイルは/etc/sudoersで、変更を表示するにはsudoまたはrootに切り替える必要があります.同様に、これもセキュリティの観点からです.
問題:
[test@oldboy ~]$ sudo su -oldboy

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for test: 
Sorry, try again.
[sudo] password for test: 
Sorry, try again.
[sudo] password for test: 
Sorry, try again.
sudo: 3 incorrect password attempts

その結果、3回のパスワードを試しても「パスワードエラーは再試行してください」というメッセージが表示され、もう一度資料をよく探してみると、ファイル/etc/sudoerが変更されていない可能性があります.
問題解決の試み1:visudoを使用して/etc/sudoersファイルを編集し、次のように表示します.
## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
##
## Examples are provided at the bottom of the file for collections
## of related commands, which can then be delegated out to particular
## users or groups.
##
## This file must be edited with the 'visudo' command.

## Host Aliases
## Groups of machines. You may prefer to use hostnames (perhaps using
## wildcards for entire domains) or IP addresses instead.
# Host_Alias     FILESERVERS = fs1, fs2
# Host_Alias     MAILSERVERS = smtp, smtp2

## User Aliases
## These aren't often necessary, as you can use regular groups