10

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] ~
3
  • 2
    Can you run it with a "-v" option to show some debug output?
    – cjc
    Sep 1, 2011 at 2:08
  • And what output you get? Did you take a look at ssh server logs?
    – quanta
    Sep 1, 2011 at 2:36
  • Looks like I just don't know where to put the key. Added -v output to origional question. Sep 1, 2011 at 14:25

3 Answers 3

7

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

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

1
  • In addition, you should also set username and assign private key in per session configuration.
    – petertc
    May 19, 2017 at 1:49
0

I'm not sure how MobaXTerm works, in terms of its login environment. Obviously from your output, ssh is looking for the key with the name /home/chip.ssh/id_rsa.

So, when you start up MobaXTerm, can you try some stuff, like running "pwd" and seeing what directory it thinks it's in and work on putting the key into there? In your ssh command, you should be able to specify the full path to the key with something like "ssh -i /path/to/ssh/key/id_rsa" plus the other ssh options you're using.

Alternatively, you may be able to specify some alternative path. If MobaXTerm is Cygwin based, you may be able to say something like "/cygdrive/c/Documents/ssh/id_rsa", which should correspond to "C:\Documents\ssh\id_rsa" on your filesystem.

7
  • pwd showed me it thinks it is in /home/X where X is the directory the .exe is in Sep 2, 2011 at 1:32
  • When I try to use /home/X/id_rsa it tells me there is no such file or directory even though I do see it there :/ Sep 2, 2011 at 1:35
  • OK, I just downloaded MobaXterm and gave it a try. I created a new key with "ssh-keygen". I'm not sure where /home/MobaXTerm actually is; it's some sort of virtual home someplace, it looks like. In any case, I was able to connect to my server by specifying: "ssh -i ./id_rsa -l username server" where id_rsa is my current directory.
    – cjc
    Sep 2, 2011 at 2:59
  • Okay, your key file is "id_rsa" and it is in the same directory as MobaXTerm.exe? Sep 5, 2011 at 13:28
  • The key was in /home/MobaXTerm. I don't know where that actually lives on the Windows filesystem. I didn't use an existing key; I created a new one in /home/MobaXTerm using "ssh-keygen".
    – cjc
    Sep 5, 2011 at 13:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .