しばらく私のサーバーで公開鍵認証を使用してきましたが、接続しようとする新しい「クライアント」に問題があります。フラッグハブ。私の権限が正しく設定されていることを確認し、githubの新しいキーを生成したことを確認するために、多くのスレッドを読みました。私が直面している問題は、sshでパスワードを設定していなくてもパスワードを入力する必要があることです。パスワードを入力しなかったことを100%確認するためにキーを再作成しました。
SSH-vvv次の関連出力を提供します。
debug1: Offering public key: /home/me/.ssh/github.pub
debug2: we sent a publickey packet, wait for reply
debug3: Wrote 368 bytes for a total of 1495
debug1: Remote: Forced command: gerve mygithubusername c3:71:db:34:98:30:6d:c2:ca:d9:51:a8:c6:1b:fc:f7
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug2: input_userauth_pk_ok: fp c3:71:db:34:98:30:6d:c2:ca:d9:51:a8:c6:1b:fc:f7
debug3: sign_and_send_pubkey
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/me/.ssh/github.pub':
なぜそのようなことを言っているのかを見ました。PEM_read_PrivateKey失敗しましたが、解決策が見つかりませんでした。
私はプロキシなどを使用しません。 ~/.ssh/config ファイルを次のように設定しました。
Host github
Host github.com
Hostname github.com
User git
PubkeyAuthentication yes
IdentityFile /home/me/.ssh/github.pub
よろしくお願いします。
ベストアンサー1
IdentityFile
options を使用すると、~/.ssh/config
プライベートを指します。大衆ではなく、キー。
からman ssh_config
:
身分証明書
ユーザーの DSA、ECDSA、または DSA 認証 ID を読み取るファイルを指定します。プロトコルバージョン1のデフォルト値は~/.ssh/identityで、プロトコルバージョン2のデフォルト値は~/.ssh/id_dsa、~/.ssh/id_ecdsa、~/.ssh/id_rsaです。
したがって、~/.ssh/config
項目は次のようにする必要があります。
Host github.com
Hostname github.com
User git
PubkeyAuthentication yes
IdentityFile /home/me/.ssh/github