Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

I have tried these formats:

ssh -p 1111 -i id_rsa chip@192.168.0.100

ssh -i id_rsa -p 1111 chip@192.168.0.100

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

Thanks!

EDIT:

[chip.client] $ ssh -p 1111 -i id_rsa chip@192.168.0.100 -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 zlib@openssh.com
debug1: kex: client->server aes128-ctr hmac-md5 zlib@openssh.com
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] ~
share|improve this question
2  
Can you run it with a "-v" option to show some debug output? –  cjc Sep 1 '11 at 2:08
    
And what output you get? Did you take a look at ssh server logs? –  quanta Sep 1 '11 at 2:36
    
Looks like I just don't know where to put the key. Added -v output to origional question. –  Chip Sprague Sep 1 '11 at 14:25

3 Answers 3

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 chip@192.168.0.100

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

share|improve this answer

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.

share|improve this answer
    
pwd showed me it thinks it is in /home/X where X is the directory the .exe is in –  Chip Sprague Sep 2 '11 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 :/ –  Chip Sprague Sep 2 '11 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 '11 at 2:59
    
Okay, your key file is "id_rsa" and it is in the same directory as MobaXTerm.exe? –  Chip Sprague Sep 5 '11 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 '11 at 13:40

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

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

Copy and paste the keys into:C:\Users\*your computer name*\Documents\MobaXterm\home

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.