
私は友達のgitlabにコードをプッシュするときに問題を見つけました。 sshで使用するように指定されたrsaキーがパスワードで暗号化されている場合、sshは私にパスワードを要求できず、後で秘密鍵を使用して認証することはできません。
パスワードとオプションを使用してデフォルトでrsaキーを生成しようとしました。
ssh-keygen -t rsa -b 4096 -o -a 100
繰り返しますが、何も変わりません。
私のシステムでsshdをホストし、私のユーザーのキーを設定してみましたが(.pubをauthorized_keysにコピー)、奇妙なことに同じ結果が出ました。キーの権限は問題ではないようです。
私は変更されていないLinuxカーネルでArchLinux 64ビットを実行しています。
ssh -i test -p 9988 -vt 127.0.0.1
以下は、sshdが主にデフォルト設定(パスワード無効、公開鍵認証のみを許可、ポート9988に設定)で実行されている私のシステムのサンプルログです。鍵は、暗号化パスワードが設定されたデフォルト設定を使用して生成されます。
OpenSSH_6.8p1, OpenSSL 1.0.2c 12 Jun 2015
debug1: Reading configuration data /home/stephen/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 9988.
debug1: Connection established.
debug1: identity file test type 1
debug1: key_load_public: No such file or directory
debug1: identity file test-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.8
debug1: match: OpenSSH_6.8 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:jNykvy5o5p79HUka+BWOqLoMqB0oo90fupUT18ERxMA
debug1: Host '[127.0.0.1]:9988' is known and matches the ECDSA host key.
debug1: Found key in /home/stephen/.ssh/known_hosts:2
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: test
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Offering RSA public key: stephen@ArchDynamo
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
編集:最近友達のgitlabにプッシュしましたが、キーパスワードの入力を求められずにプッシュされたことに気づきました。これは私のssh-keygenが破損していることを意味しますか?