デプロイ後の最低限の設定

まずはデプロイ時に設定したrootのパスワードでsshログインして、 rootのブルーフォースアタックの脅威から守るために他のユーザを通してrootの作業をするように設定をする。

作業用ユーザの作成

$ adduser *******
$ passwd *******
$ usermod -G wheel *********

作業用ユーザでsu rootの許可設定

$ 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ログインできないようにする

$ vi /etc/ssh/sshd_config
/PermitRootLogin

と入力し、該当行が

# PermitRootLogin yes

となっているのでコメントアウトを外し、noに設定する

PermitRootLogin no


リロード   差分   ホーム 一覧 検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS