CentOSで一般ユーザーをsudoグループに追加し、パスワードなしでログインする
1.1 sudo
Sudoはlinuxシステムにおいて、root権限以外のユーザが自分の権限を昇格させて特定の特性コマンドを実行する方法であり、一般ユーザがスーパーユーザのパスワードを知らない場合でも、root権限を一時的に取得することができる.一般的に、一般ユーザが特殊コマンドを実行するのは、yumのような特殊コマンドの前にsudoを付け、自分のユーザパスワードを入力するだけでよく、その後5分以内に特殊コマンドを再使用する場合、ユーザパスワードを再入力する必要はありません.
同時に、sudoは強力なログ管理を提供し、各ユーザーが何をしたかを詳細に記録しています.
sudoユーザの管理は、ファイル:/etc/sudoersに格納されます.すなわち,あるユーザをsudoユーザ群に加入させるには,このファイルを自分で構成し,このファイルを読み書きする際にrootの権限が必要である.
1.2 sudoグループへのユーザーの追加
sudoを使用する場合、「dba is not in the sudoers file.This incident will be reported.」と表示されると、現在のユーザー名:dbaはsudoを使用する権限がありません.この場合、/etc/sudoersを変更して現在のユーザーdbaにsudo権限を追加する必要があります.[dba@oracle ~]$ sudo yum -y update
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 dba:
dba is not in the sudoers file. This incident will be reported.
[dba@oracle ~]$