2017-09-23 20 views
0

私はubuntuワークステーションにssh_rsa & ssh_rsa.pubを生成しましたので、sshを使ってgitlabにアクセスできました。
これはうまくいきました。今では私のPCもこれらのキーを使いたいと思っています。
私のubuntuワークステーションから生成されたid_rsaをコピーし、git-bash経由で/C/users/myUserName/.ssh/に貼り付けました。windowsでubuntu rsaキーを使用する

しかし、私のPCはまだレポをgitlabに接続することはできません、それは印刷します

デフォルトで
$ ssh -v [email protected] -P 22 
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015 
debug1: Reading configuration data /c/Users/<username>/.ssh/config 
debug1: /c/Users/<username>/.ssh/config line 2: Applying options for gitlab.company.com 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: Connecting to gitlab.company.com [192.xxx.xxx.x] port 22. 
debug1: Connection established. 
debug1: identity file /c/Users/<username>/.ssh/id_rsa type 1 
debug1: key_load_public: No such file or directory 
debug1: identity file /c/Users/<username>/.ssh/id_rsa-cert type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /c/Users/<username>/.ssh/id_dsa type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /c/Users/<username>/.ssh/id_dsa-cert type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /c/Users/<username>/.ssh/id_ecdsa type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /c/Users/<username>/.ssh/id_ecdsa-cert type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /c/Users/<username>/.ssh/id_ed25519 type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /c/Users/<username>/.ssh/id_ed25519-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_7.1 
ssh_exchange_identification: read: Connection reset by peer 

答えて

0

、sshは、.ssh/id_rsa(.pub)ためないssh_rsaを見ていきます。

最初に、それらのキー(プライベートとパブリック)の名前をデフォルト名に変更してみてください。

公開鍵(%USERPROFILE%\.ssh\id_rsa.pubでコピーされています)がの1つの行としてコピーされていることを確認してください。

注:プライベートの両方の公開鍵をコピーする必要があります。

少なくとも、コピーした秘密鍵id_rsaの公開鍵を生成します。

cd %USERPROFILE%\.ssh 
ssh-keygen -y -f id_rsa > id_rsa.pub 

あなた%PATH%にGitのパスを追加してください:

> where ssh-keygen 
D:\prgs\git\latest\usr\bin\ssh-keygen.exe