Fedora 25
Sponsored Link

一般ユーザー追加2016/11/22

[1] 一般ユーザーを追加する場合は以下のように設定します。
[root@localhost ~]#
useradd fedora

[root@localhost ~]#
passwd fedora

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

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

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

[2] root ユーザーアカウント(管理者ユーザー)にスイッチする場合は以下のようにします。 誤操作を避けるため、必要がある時のみ rootユーザーにスイッチして作業しましょう。
localhost login:
fedora
# ログインユーザー名を入力

password:
# パスワード入力

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

Password:
# rootパスワード入力

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

[3] root ユーザーアカウントにスイッチ可能なユーザーを限定します。例として[1]で追加した fedora のみに限定するには以下のように設定します。
[root@localhost ~]#
usermod -G wheel fedora

[root@localhost ~]#
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            substack        system-auth
auth            include         postlogin
account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         include         postlogin
session         optional        pam_xauth.so
関連コンテンツ