- 追加された行はこの色です。
- 削除された行はこの色です。
** デプロイ後の最低限の設定 [#uc1c1ec0]
まずはデプロイ時に設定したrootのパスワードでsshログインして、
rootのブルーフォースアタックの脅威から守るために他のユーザを通してrootの作業をするように設定をする。
*** 作業用ユーザの作成 [#b8ad05d1]
$ adduser *******
$ passwd *******
$ usermod -G wheel *********
*** 作業用ユーザでsu rootの許可設定 [#h754323f]
$ vi /etc/pam.d/su
# auth required pam_wheel.so use_uid
の#を削除して下記のようにする
#%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
*** sshでrootログインできないようにする [#j8665189]
$ vi /etc/ssh/sshd_config
/PermitRootLogin
と入力し、該当行が
# PermitRootLogin yes
となっているのでコメントアウトを外し、noに設定する
PermitRootLogin no