(私が知っている限り)すべてを試しましたが、SSHはまだパスワードを求めます。

(私が知っている限り)すべてを試しましたが、SSHはまだパスワードを求めます。

本に基づいてすべてのことを行いましたが、sshはまだパスワードを要求します。最初からすべての出力を含めました。どんなアイデアがありますか?

ありがとうございます!

ゲイリー

  1. パブリック/プライベートrsaキーペアの作成とlocalhostの権限の確認

編集:=>それが問題であることがわかりました。最初のコメントで「Mat」が指摘したように、キーペアはローカルシステムではなくリモートシステムで作成する必要があります。これを行う方法を知りたい場合は、ソリューションの多くの説明を読んでください。

on local computer:
mms: admin$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/admin/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/admin/.ssh/id_rsa.
Your public key has been saved in /Users/admin/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:ekIFdhbYVGnWsRcpyhPXRPDF5LTqYI+u6l3URsIjC90 [email protected]
The key's randomart image is:
+---[RSA 2048]----+
|      o+=o.oo*+++|
|     ..+o B +oo=o|
|       ..* E.oo..|
|       .. * =..  |
|      . S. = +   |
|     . .  o *    |
|      o .  o o   |
|       o. o      |
|      .o.o..     |
+----[SHA256]-----+

mms: admin$ pwd && ls -al
/Users/admin/.ssh
total 16
drwx------   4 admin  staff   136 Dec 26 09:37 .
drwxr-xr-x+ 32 admin  staff  1088 Dec 26 08:53 ..
-rw-------   1 admin  staff  1675 Dec 26 09:37 id_rsa
-rw-r--r--   1 admin  staff   401 Dec 26 09:37 id_rsa.pub
  1. 公開鍵のコピー:(リモートホストはリモートでアクセスできないため、リモートホストから)

    サーバー: .ssh aase$ scp[Eメール保護]:.ssh/id_rsa.pub ~/.ssh/authorized_keys 'domain-of-local-computer.com(123.456.789.012)' ホストの信頼性を確認できません。 RSA キーの指紋は 1f:14:32:84:c4:f8:4e:25:df:2d:56:49:e6:e5:79:1d です。引き続き接続しますか(Y/N)?例警告:既知のホストのリストに「domain-of-local-computer.com,123.456.789.012」(RSA)を永久に追加します。パスワード: id_rsa.pub 100% 401 0.4KB/s 00:00

  2. 秘密鍵をコピーして権限を確認します。

   修正(提案基準)

server:.ssh ahase$ scp [email protected]:.ssh/id_rsa ~/.ssh/id_rsa
Password:
id_rsa
100% 1675     1.6KB/s   00:00    
server:.ssh ahase$ ls -al
server:.ssh ahase$ scp [email protected]:.ssh/id_rsa ~/.ssh/id_rsa
Password:
id_rsa                                                                                                        100% 1675     1.6KB/s   00:00    
server:.ssh ahase$ ls -al
total 24
drwx------   5 ahase  staff   170 26 Dez 12:07 .
drwxr-xr-x+ 18 ahase  staff   612 10 Dez 09:19 ..
-rw-------   1 ahase  staff   401 26 Dez 09:58 authorized_keys
-rw-------   1 ahase  staff  1675 26 Dez 12:07 id_rsa
-rw-r--r--   1 ahase  staff   410 26 Dez 09:58 known_hosts
  1. sshはまだパスワードを要求します(-vvv出力)。 【変更後の編集推奨】

    サーバー: .ssh aase$ ssh -vvv[Eメール保護] OpenSSH_5.2p1、OpenSSL 0.9.8k 2009年3月25日 debug1: 構成データ /etc/ssh_config 読み込み debug2: ssh_connect: needpriv 0 debug1: domain-of-local-computer.com [123.456.782.2 debug1:接続が確立されました。 debug1: ID ファイル /Users/ahase/.ssh/identity タイプ -1 debug3: RSA1 鍵ファイル /Users/ahase/.ssh/id_rsa ではありません。 debug2: key_type_from_name: 不明なキータイプ '------BEGIN' debug3: key_read: キータイプがありません debug3: key_read: 空白がありません debug3: key_read: 空白がありません debug3: key_read: 空白がありません debug3: key_read: : key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key_read: 空白の欠落 debug3: key欠落 debug3: key_read: 空白欠落 debug3: key_read: 空白欠落 debug3: key_read: 空白欠落 debug3: key_read: 空白欠落 debug3: key_read: 空白欠落 debug3: key_read: 空白欠落 debug2: key_type_fr ---END ' debug3 : key_read: 欠落しているキーの種類2.0、リモートソフトウェアバージョンOpenSSH_6。 9 debug1:一致:OpenSSH_6.9 pat OpenSSH * debug1:プロトコル2.0の互換モードを有効にするdebug1:ローカルバージョン文字列SSH-2.0-OpenSSH_5.2 debug2:fd 3 O_NONBLOCK設定nit: diffie -hellman-group-exchange-sha256, diffie-hellman-group -exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa, ssh-dss debug2: kex_parse_kexi: -ctr、aes192-ctr、aes256-ctr、arcfour256、arcfour128、aes128-cbc、3des-cbc、フグ-cbc、cast128-cbc、aes192-cbc、aes256-cbc、arcfour、[Eメール保護] debug2: kex_parse_kexinit: aes128-ctr, aes192-ctr, aes256-ctr, arcfour256, arcfour128, aes128-cbc, 3des-cbc, Blowfish-cbc, Cast128-cbc, aes192-[Eメール保護] デバッグ 2: kex_parse_kexinit: hmac-md5, hmac-sha1,[Eメール保護],hmac-ripemd160,[Eメール保護],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[Eメール保護],hmac-ripemd160,[Eメール保護],hmac-sha1-96,hmac-md5-96 debug2:kex_parse_kexinit:none,[Eメール保護]、zlib debug2:kex_parse_kexinit:なし、[Eメール保護], zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: 予約済み 0 debug2: kex_parse_kexinit:[Eメール保護], ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group-exchange-sha256, diffie-hellman-group14-sha1 debug2: kex_parse_kexinit: ssh-ssa sha2-nistp256, ssh-ed25519 debug2: kex_parse_kexinit:[Eメール保護],aes128-ctr,aes192-ctr,aes256-ctr,[Eメール保護][Eメール保護] デバッグ 2: kex_parse_kexinit:[Eメール保護],aes128-ctr,aes192-ctr,aes256-ctr,[Eメール保護][Eメール保護] デバッグ 2: kex_parse_kexinit:[Eメール保護][Eメール保護][Eメール保護][Eメール保護][Eメール保護][Eメール保護][Eメール保護],hmac-sha2-256,hmac-sha2-512,hmac-sha1 デバッグ2: kex_parse_kexinit:[Eメール保護][Eメール保護][Eメール保護][Eメール保護][Eメール保護][Eメール保護][Eメール保護],hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: kex_parse_kexinit: なし,[Eメール保護] debug2: kex_parse_kexinit: なし,[Eメール保護] debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: 予約済み 0 debug2: mac_setup: hmac-sha1 bug2:mac_setup:hmacが見つかりました- sha1 debug1: kex: クライアント->サーバー aes128-ctr hmac-sha1 なし debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) 送信された debug1: SSH2_MSG_KEX_DH_GEX_GROUP debug2: ビットセット: 1048/2048 debug1: SSH2_MSG_KEX_DH_GEX_INIT 送信 debug1: SSH2_MSG_KEX_DH_GEX_REPLY 必要 debug3: check_host_in_hostfile: ファイル名/Users/ahase/.ssh/known_host_ check_host_in_hostfile: ファイル名/Users/ ahase/.ssh/known_hosts debug 3:check_host_in_hostfile:一致1行debug1:ホスト「domain-of-local-computer.com」が知られており、RSAホストキーと一致します。 debug1: /Users/ahase/.ssh/known_hosts:1 で見つかったキー debug2: ビットセット: 1023/2048 debug1: ssh_rsa_verify: 正しく署名済み debug2: kex_derive_keys debug2: set_newkeys: モードG_NEWKEYS 必須 debug2 : set_newkeys : モード 0 debug1: SSH2_MSG_NEWKEYS 受信 debug1: SSH2_MSG_SERVICE_REQUEST debug2 送信: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT 受信 debug2: キー: /Users /ahase/。 ssh/ id_rsa (0x0) debug2: キー: /Users/ahase/.ssh/id_dsa (0x0) debug1: 認証を継続可能: 公開鍵、キーボード対話型 debug3: 再起動、他のリストを渡す公開鍵、キーボード対話式 debug3 : 基本公開鍵、キーボード対話、パスワード debug3: authmethod_lookup publickey debug3: 残りの優先: キーボード対話、パスワード debug3: authmethod_is_enabled publickey debug1: 次の認証方法: publickey debug1: 秘密鍵の試行: /Users/ahase/.sh debug3: 対応する ID なし: /Users/ aase/.ssh/identity debug1: 秘密鍵の試行中: /Users/ahase/.ssh/id_rsa debug1: PEM 秘密鍵読み取り完了: RSA 入力 debug3: sign_and_send_pubkey debug2: us 公開鍵パケット送信済み、応答待機中 debug1: 認証を続行できます。 公開鍵、キーボード対話 debug1: 秘密鍵を試しています。 id_dsa debug2:パケットを送信していない、メソッドdebug3:authmethod_lookupキーボードインタラクションdebug3:残りのデフォルト設定:パスワードdebug3:authmethod_is_enabled応答を待っています。 debug2: input_userauth_info_req debug2: input_userauth_info_req: num_prompts 1

    パスワード:

    debug3:packet_send2:32追加(len 21 padlen 11 extra_pad 64)debug2:input_userauth_info_req debug2:input_userauth_info_req:num_prompts 0 debug3:packet_send2:48追加)。 debug1:チャネル0:新しい[クライアントセッション] debug3:ssh_session2_open:チャネル_new:0 debug2:チャネル0:開く送信debug1:要求[Eメール保護] debug1:対話型セッションに入ります。 debug1: client_input_global_request: rtype[Eメール保護]Want_reply 0 debug2: コールバックを開始0 rmax 32768 debug2: チャネル_input_status_confirm: タイプ 99 id 0 debug2: チャネル 0 で PTY 割り当て要求が許可される debug2: チャネル 0: rcvd Tweak 2097152 debug2: チャネル_input_status_confirm: タイプ 99 id最終ログイン: 12月 土曜日 26日 12:22:40 2015年 123.456.789.012 MMSで: ~ admin$

ログファイルを表示できません(/var/log/auth.logまたは/var/log/daemon.logが存在せず、そのファイルがどこにあるのかわかりません)。ローカルコンピュータは10.10.5を実行しているMac、リモートコンピュータは10.6を実行しているMacです(変更できません)。

ありがとうございます!

ベストアンサー1

(」という言葉が気になります。[Eメール保護]「問題が発生する可能性があります。これはローカルネットワークのローカルホスト名です。fritz.boxはルーター名です。)

いいえコメントだけを付けてください

debug1: identity file /Users/name/.ssh/id_rsa type -1
[...]
debug1: Trying private key: /Users/name/.ssh/id_rsa
debug3: no such identity: /Users/name/.ssh/id_rsa

あなたのクライアントはこのキーを使用していません。

@Matのコメントによると、クライアントは異なる方法で設定する必要があります~/.ssh/id_rsa~/.ssh/authorized_keys

おすすめ記事