1

I have created lately in Windows ssh key - so I have .ppk file. Converted it also to openssh. In windows I have been using tortoise with pageant to connect to svn+ssh server. Now I want to switch to linux. How can I connect to svn+ssh with this key .ppk or opessh file. I would like to use PagaVCS or RabbitVCS but it keeps asking me for login and password which obviously I don't have because I have only this openssh or .ppk file. Anyone could help??

4

3 回答 3

4

Use puttygen to convert the key to openssh format. It is for example described here: http://leadingedgescripts.co.uk/server-administration/how-to-convert-your-putty-ppk-private-key-to-a-normal-ssh-key-you-can-use-on-an-apple-mac/

Unfortunately no experience with either Rabbit or the other one. In *nix environment I would create $HOME/.ssh/config and write something like that:

Host host
User user
IdentityFile /path/to/your/key

And then use svn+ssh://host/directory (ssh then takes configuration information from the .ssh/config file). Maybe something like can be done with one of the VCS's?

As last (or first in my case) resort I'd use cygwin or mingw and configure ssh access there - and then configure the tools to use ssh coming from these packages.

于 2011-06-25T14:22:47.450 回答
1

Puttygen exports private keys DES encoded, which causes some software (e.g. OpenSSH on Ubuntu) to silently ignore the key and prompt for password.

To use PuTTY .ppk key in linux OpenSSH, first export the key:

  1. Start puttygen
  2. File -> Loadprivate key
  3. Conversions -> Export OpenSSH key (private.key in this example)

Now, on the linux machine, re-encrypt the key using passphrase change command:

ssh-keygen -pf private.key

Enter the same passphrase 3 times (old, new, new) to actually not change it.

Now you can check the key file that DEK-Info: changed from something like DES-EDE3-CBC,F1785C4B846C781F to AES-128-CBC,916627D6328608175FA4545928372EA3.

The client application should not promt you for password anymore.

于 2012-06-22T14:10:04.673 回答
0

我确信这个问题的答案是在线的,但我似乎无法再在任何地方找到它,所以它从头到尾都在这里,包括你说你已经完成的转换:

  1. 在 Windows 上打开 puttygen。
  2. 如果需要,使用密码加载您的私钥 (name.ppk)。
  3. 转到“转换”->“导出 OpenSSH 密钥”并将其另存为(我假设您将其称为“文件名”)。
  4. 将此密钥复制到 Linux 上的主目录中。
  5. 打开终端并使用命令 'mv fileName .ssh/' 将其移动到 .ssh 目录(~/.ssh 隐藏在 gui 中,但它就在那里)。
  6. 使用“cd .ssh”导航到 .ssh 目录
  7. 使用命令“cat fileName > id_rsa”将文件转换为名为 id_rsa 的新文件。
  8. 使用命令“chmod 600 id_rsa”将 id_rsa 的权限更改为 600。
  9. 最后确保 .ssh 目录的权限设置为 700 'cd ..' 以拖放到主目录,并确保 'chmod 700 .ssh' 设置权限。

这应该这样做。

那里一定有更好的信息,但这个链接有一些你可能会觉得有趣的东西,特别是关于许可的一点http://www.lamolabs.org/blog/6241/one-liner-working-with-ssh-keygen-ssh -密钥对文件/

于 2012-07-24T16:33:48.967 回答