SSHキーパスフレーズはWindowsで機能しますが、Linuxでは機能しません

StackOverflow https://stackoverflow.com//questions/9631246

  •  10-12-2019
  •  | 
  •  

質問

私はgitのプロジェクトに働いています。 Windowsでは、このプロジェクトを管理するためにGit Extensionsを使用しています。私はそれをgit拡張子にロードして、彼らが私に与えたパスフレーズで、そしてそれが機能します。

今度はLinux(Ubuntu-32bit)仮想マシンを設定し、このマシンからリポジトリにもアクセスしたいです。

このサイトで見た別のスレッドから、私がリポジトリを複製するために、次のコマンドを使用します。

ssh-agent bash -c 'ssh-add /home/myHome/mykey.ppk; git clone git@serveraddress:project.git'
.

それでは、シェルはパスフレーズを挿入するように教えてくれる

Enter passphrase for /home/myHome/mykey.ppk:
.

しかし、私がそれを挿入するとき、それは私にそれが悪いパスフレーズです。私はそれをたくさんチェックしました、そして私がWindowsで使用するのと同じパスフレーズを使うことを確信しています。では、Linuxのキーを正しく使用できますか?

あなたの返事のために事前にありがとう。

役に立ちましたか?

解決

The Linux SSH client (typically OpenSSH) can't read the PPK format used by the Windows SSH client Putty. You need to convert the "PPK" key given to you into an OpenSSH key first. Install "putty" on Linux and use the puttygen command line tool:

$ sudo aptitude install putty
$ mkdir -p ~/.ssh
$ puttygen ~/mykey.ppk -o ~/.ssh/id_rsa -O private-openssh

Enter your passphrase, and you'll get an OpenSSH-compatible key in the standard location ~/.ssh/id_rsa. Afterwards you can just use ssh-add(without any arguments!) to add this key to the SSH agent.

Alternatively you can use the PUTTYgen program provided by putty on Windows.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top