Fedora 10
Sponsored Link

管理用一般ユーザー作成2008/11/26

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

[root@ns ~]#
passwd fedora

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

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

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

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

password:
# パスワード入力

[fedora@ns ~]$
su -
# rootユーザーに遷移

Password:
# rootパスワード入力

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

[3] rootになれるユーザーを[1]で追加したfedoraのみにします。
[root@ns ~]#
vi /etc/group


# 11行目:追加したいユーザー名を追記

wheel:x:10:root
,fedora


[root@ns ~]#
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@ns ~]#
vi /etc/login.defs


# ファイルの末尾に該当行追記

SU_WHEEL_ONLY yes

root宛メール転送
[4] root宛に送られてくるメールを管理用に作成した一般ユーザーに転送します。
[root@ns ~]#
vi /etc/aliases


# Person who should get root's mail
# 最終行頭の#を削除し転送するユーザー名に変更

root:
fedora


[root@ns ~]#
# 設定の変更を反映

/etc/aliases: 77 aliases, longest 10 bytes, 776 bytes total
関連コンテンツ