我有一个关键,我转换和腻子工作正常。
我试过这些格式:
ssh -p 1111 -i id_rsa [email protected] ssh -i id_rsa -p 1111 [email protected]
密钥与MobaXTerm可执行文件位于同一个文件夹中。
谢谢!
编辑:
[chip.client] $ ssh -p 1111 -i id_rsa [email protected] -v Warning: Identity file id_rsa not accessible: No such file or directory. OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011 debug1: Reading configuration data /etc/ssh_config debug1: Connecting to 192.168.0.9 [192.168.0.100] port 1111. debug1: Connection established. debug1: identity file /home/chip/.ssh/id_rsa type -1 debug1: identity file /home/chip/.ssh/id_rsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu7 debug1: match: OpenSSH_5.3p1 Debian-3ubuntu7 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.6 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5 [email protected] debug1: kex: client->server aes128-ctr hmac-md5 [email protected] debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: checking without port identifier Warning: Permanently added '[192.168.0.100]:1111' (RSA) to the list of known hosts. debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: /home/chip/.ssh/id_rsa debug1: No more authentication methods to try. Permission denied (publickey). [01/09/2011 - 09:15.38] ~
MobaXterm默认使用主目录位置作为Windows Temp目录。 因此,您closuresMobaXterm后创build的密钥将不可用。
一旦生成密钥,将其保存在Windows驱动器的不同文件夹中,并通过“-i”选项中的完整path引用。 Windows驱动器在MobaXterm中被称为'/ drives / c /','drives / d /'等。 如果私钥保存在E:\ keys \ id_rsa那么该命令将看起来像,
ssh -p 1111 -i /drives/e/keys/id_rsa [email protected]
如果您定期使用MobaXterm,处理这个问题的最佳方法是使用主目录的永久位置而不是默认的Temp目录。 你可以通过设置 – >configuration – >其他选项 – >使用下面的persisten HOME目录来实现 。 在这种情况下,密钥可以保留在主目录中,而不需要提供“我”选项
如果您已经通过Putty或其他方式设置了密钥,最简单的方法就是将其复制粘贴到MobaXterm主目录中。
腻子的默认位置通常是C:\users\.ssh
将密钥复制并粘贴到: C:\Users\*your computer name*\Documents\MobaXterm\home
就其login环境而言,我不确定MobaXTerm是如何工作的。 显然从你的输出中,ssh正在寻找名为/home/chip.ssh/id_rsa的密钥。
所以,当你启动MobaXTerm的时候,你可以尝试一些东西,比如运行“pwd”,看看它认为是在哪个目录下,然后把密钥放到那里? 在你的ssh命令中,你应该能够用“ssh -i / path / to / ssh / key / id_rsa”加上你正在使用的其他ssh选项来指定密钥的完整path。
或者,您可以指定一些替代path。 如果MobaXTerm是基于Cygwin的,你可能会说“/ cygdrive / c / Documents / ssh / id_rsa”,它应该对应于文件系统上的“C:\ Documents \ ssh \ id_rsa”。