SSH 公開鍵、秘密鍵の作成
$ ssh-keygen
$ mv .ssh/* ./
クライアントPCにコピーした秘密鍵 id_rsaは、隠しフォルダ .ssh内に移動。
$ chmod 700 .ssh
$ mv id_rsa.pub .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys
sshのポート開ける
# firewall-cmd --permanent --add-service=ssh
success
# firewall-cmd --reload
success
sshd設定ファイルの修正
以降の操作を行うと、
通常のログインが出来なくなります。
# nano /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
PermitRootLogin no # 許可しない
#PasswordAuthentication yes
PasswordAuthentication no # パスワード認証しない
$ reboot