Scientific Linux 6
Sponsored Link

管理用一般ユーザー作成2011/03/13

[1] 管理用の一般ユーザーを作成します。
[root@dlp ~]#
useradd fermi

[root@dlp ~]#
passwd fermi

Changing password for user fermi.
New UNIX password:
# 設定したいパスワードを入力

Retype new UNIX password:
# パスワード再入力

passwd: all authentication tokens updated successfully.
[root@dlp ~]#
# ログアウト

[2] 以降は、まず、一般ユーザーでログインし、必要があるときのみ、rootユーザーにスイッチして作業するようにします。 rootユーザーは何でもできるため、誤操作により重要なファイルを消してしまうのを避けるためです。
dlp login:
fermi
# ログインユーザー名を入力

password:
# パスワード入力

[fermi@dlp ~]$
su -
# rootユーザーに遷移

Password:
# rootパスワード入力

[root@dlp ~]#
# rootユーザーに遷移完了

[3] rootになれるユーザーを[1]で追加したfermiのみにします。
[root@dlp ~]#
vi /etc/group
# 11行目:追加したいユーザー名を追記

wheel:x:10:root
,fermi
[root@dlp ~]#
vi /etc/pam.d/su
#%PAM-1.0
auth
sufficient
pam_rootok.so

# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth
sufficient
pam_wheel.so trust use_uid

# Uncomment the following line to require a user to be in the "wheel" group.
# 以下の行の行頭にあった#を削除しコメント解除

auth
required
pam_wheel.so use_uid

auth
include
system-auth

account
sufficient
pam_succeed_if.so uid = 0 use_uid quiet

account
include
system-auth

password
include
system-auth

session
include
system-auth

session
optional
pam_xauth.so

root宛メール転送
[4] root宛に送られてくるメールを管理用に作成した一般ユーザーに転送します。
[root@dlp ~]#
vi /etc/aliases
# Person who should get root's mail
# 最終行頭の#を削除し転送するユーザー名に変更

root:
fermi
[root@dlp ~]#
# 設定の変更を反映

関連コンテンツ