openSUSE - 15.2 - visudo

クラウディア 
1. 概要
2. 設定

1. 概要

 「sudo」は、デフォルトでインストールされています。  しかし、わたしのインストール方法に問題があるのか。  すべてのユーザで「sudo」を実行でき、パスワードが「root」ユーザのものである。  これはこれで、ひとつの運用方法かとも思います。

2. 設定

 「root」ユーザで

visudo

## In the default (unconfigured) configuration, sudo asks for the root password.
## This allows use of an ordinary user account for administration of a freshly
## installed system. When configuring sudo, delete the two
## following lines:
Defaults targetpw   # ask for the password of the target user i.e. root
ALL   ALL=(ALL) ALL   # WARNING! Only use this together with 'Defaults targetpw'!

##
## Runas alias specification
##

##
## User privilege specification
##
root ALL=(ALL) ALL
 68、69行の先頭に「#」をいれて、コメントアウトします。  78行の例にならって

ユーザ名 ALL=(ALL) ALL
 と記述することで、指定したユーザのみ「sudo」コマンドが使用でき、かつ、ユーザのパスワードで実行できます。
earthcar(アースカー)