< All Topics
Print

SSH RSA認証設定登録

SSHでRSA認証を使用してログインする場合の設定

PCでSSH-keyを作成
# ssh-keygen

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/******/.ssh/id_rsa):  Enterをクリック
/Users/******/.ssh/id_rsa already exists.

Enter passphrase (empty for no passphrase):  ログイン名 (ログイン時に入力するパスフレーズ)
Enter same passphrase again:
Your identification has been saved in /Users/******/.ssh/id_rsa.
Your public key has been saved in /Users/******/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:キーナンバーが生成 ****@++++++.local
The key’s randomart image is:

+—[RSA 2048]—-+
|          ****|

|         ****|

|      ****|

|     ****|

|      **** |

|     ****|

|    ****|

|     ****|

|    **** |

+—-[SHA256]—–+

/Users/******/.ssh/id_rsa :秘密鍵

—–BEGIN OPENSSH PRIVATE KEY—–

********

—–END OPENSSH PRIVATE KEY—–

サーバー側 .ssh/authorized_keys にコピペ↓

/Users/******/.ssh/id_rsa.pub :公開鍵

ssh-rsa ****** ****@++++++.local

cd .ssh

chmod 600 id_rsa

chmod 600 id_rsa.pub

mkdir .ssh

chmod 700 .ssh

cd .ssh

vi authorized_keys

ssh -i id_rsa root@IPアドレス -p ポート番号

ログイン名

Table of Contents