SSH ペアキー認証の問題

SSH ペアキー認証の問題

公開キーと秘密キーの認証に問題があります。次の手順を実行しましたが、公開キー ベースが機能しません。1- 次のコマンドを使用して、秘密キーと公開キー (RSA) のペアを生成します。

Generating public/private rsa key pair.
Enter file in which to save the key (/home/rc_ss/.ssh/id_rsa): 
Created directory '/home/rc_ss/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/rc_ss/.ssh/id_rsa.
Your public key has been saved in /home/rc_ss/.ssh/id_rsa.pub.
The key fingerprint is:
ac:fd:d1:2e:e5:1e:db:87:98:77:9e:14:62:db:97:f0 rc_ss@rc_ss-network
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|       .         |
|        S    + . |
|       o   .o * o|
|      . . .oo+ E.|
|         ..o+++ =|
|          .o+..=.|
+-----------------+

2- 次のようにssh-copy-idを使用してネットワーク経由でコピーします

rc_ss@rc_ss-network:~$ ssh-copy-id -i .ssh/id_rsa.pub [email protected]
The authenticity of host '192.168.2.100 (192.168.2.100)' can't be established.
ECDSA key fingerprint is 33:67:e0:02:b1:10:46:76:78:6b:1f:e2:55:9b:6a:a8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.2.100' (ECDSA) to the list of known hosts.
[email protected]'s password: 
Now try logging into the machine, with "ssh '[email protected]'", and check in:

  ~/.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

3- 次に、パスワードなしでサーバーの ssh に接続し、次の操作を実行します。

rc_ss@rc_ss-network:~$ ssh [email protected]
[email protected]'s password: 

つまり、パスワードはまだ必要です。誰か助けてくれませんか? よろしくお願いします。

答え1

公開鍵がターゲット サーバーに正しくコピーされたと仮定すると、SSH デーモンがパスワードなしのログインをサポートしていることを確認する必要があります。この構成はファイルで設定され/etc/ssh/sshd_config、次の値が設定されていることを確認する必要があります。

PermitRootLogin yes
RSAAuthentication yes
PubkeyAuthentication yes

これらの値が設定されていない場合は、値を設定し、sudo service ssh restartターミナル内で SSH を再起動する必要があります。

関連情報