MobaXTerm - SSH Key authentication

I have a key that I converted and works fine with Putty.

I have tried these formats:

ssh -p 1111 -i id_rsa [email protected]

ssh -i id_rsa -p 1111 [email protected]

The key is in the same folder as the MobaXTerm executable.

Thanks!

EDIT:

[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] ~

Solution 1:

MobaXterm by default uses the home directory location as windows Temp directory. So the keys you create will not be available as soon as you close MobaXterm.

Once the key is generated, keep that in a different folder in your windows drives and refer it by complete path in the "-i" option. The windows drives are referred as '/drives/c/', 'drives/d/' etc in MobaXterm. If the private key is kept at E:\keys\id_rsa then the command will look like,

ssh -p 1111 -i /drives/e/keys/id_rsa [email protected]

If you're using MobaXterm regularly, the best way to deal with this is to use a permanent location for the home directory rather than the default Temp directory. You can do this by going to Settings->Configuration->Miscellaneous Options -> Use the following persisten HOME directory. In this case the keys can stay in the home directory and you need not supply an "i" option

Solution 2:

If you already have keys setup via Putty or something else the easiest thing to do is to copy and paste them into the MobaXterm's ssh directory.

So copy them then paste the keys into:C:\Users\%USERNAME%\Documents\MobaXterm\home\.ssh

Note:

Putty's default location is usually C:\Users\.ssh

Cygwin's default location is usually C:\cygwin64\home\%USERNAME%\.ssh