Hello,
I installed Cmder with Chocolately on Windows 8.1. It seems by default it installs under C:\Tools
Then I installed boot2docker for Windows.
When I ssh to the boot2docket vm from boot2docker start, it does not ask for any password, as the public / private keys are in C:\Users\Willem.ssh
I would have expected Cmder also look in C:\Users\Willem.ssh for keys, but apparently it does not. When I explicitly define the location of the boot2docker private key like this it does work:
ssh -v2 -i C:\Users\Willem.ssh\id_boot2docker [email protected]
So is there a way to make Cmder look at C:\Users\Willem.ssh for keys? Where does it look by default? I tried moving the .ssh folder to C:, to C:\toolscmderconfig
Please advise how to make Cmder look at the correct .ssh folder.
Tried adding environment variable 'HOME' with value '%USERPROFILE%' but it didn't not help.
Thanks and grtz
Willem
I do not maintain the chocolatey version of cmder, my only suggestion is to try an official release here on GitHub and try using that.
Thanks MartiUK. I will try your suggestion. Can you just tell me where Cmder will look by default for ssh keys?
By default msysgit uses %HOME%\.ssh
So In your case that would be C:\Users\Willem\.ssh
I downloaded the latest version of Cmder from Github and put it in my Dropbox account this time/
C:\Users\Willem.ssh exists and has the correct keys in for the boot2docker vm as when I use the boot2docker start.sh script, I do not have to give any password.
When I use Cmder to ssh to boot2docker
ssh [email protected]
It keeps asking me for my password hence I still think Cmder / msysgit does not find %HOME%.ssh
Tried adding HOME environment variable to Windows, but it does not seem to help.
Also tried with HOME=C:\Users\Willem\
Still does not work.
Any help to make this work is highly appreciated. I'm not sure how I could find out where things are going wrong.
Just to clarify, the folder you have your keys in is C:\Users\Willem.ssh not C:\Users\Willem\.ssh?
Hey MartiUk,
The folder where my ssh keys are located is C:\Users\Willem.ssh
.ssh is a folder, see this screenshot:
Have the same pathing and got the exact same problem
Same problem here.
If you run ssh -v [email protected] where is it looking for the identity files? Mine for example says debug1: identity file /c/Users/Martin/.ssh/id_rsa type 1
Aha, that fixed it for me, I was using the one github for windows created, which was named github_rsa, just renamed it id_rsa :+1: Thanks.
位 ssh -v [email protected]
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to github.com [192.30.252.129] port 22.
debug1: Connection established.
debug1: identity file /c/Users/Willem/.ssh/identity type -1
debug1: identity file /c/Users/Willem/.ssh/id_rsa type -1
debug1: identity file /c/Users/Willem/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version libssh-0.6.0
debug1: no match: libssh-0.6.0
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-sha1 none
debug1: kex: client->server aes128-cbc hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
The authenticity of host 'github.com (192.30.252.129)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.129' (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: 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: /c/Users/Willem/.ssh/identity
debug1: Trying private key: /c/Users/Willem/.ssh/id_rsa
debug1: Trying private key: /c/Users/Willem/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
I hope this helps to identify the issue? When I connect to my boot2docker vm, it still asks for the password. ssh keys are in C:\Users\Willem.ssh
MartiUK, I got it working! It was some time ago I did this, so I though I'd generate new keys and try again. After doing the following when in the user folder:
ssh-keygen -t rsa
ssh-copy-id [email protected]
cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
I can connect from Cmder to Boot3Docker without password. Thanks for the help and the patience!
@willemdh If you're trying to ssh to your boot2docker you need to specify the id file you want ssh to use i.e. ssh -i c:\Users\Willem\.ssh\id_boot2docker username@hostname
to make ssh use it all the time add this into your .ssh/config file
Host hostname
IdentityFile C:\Users\Willem\.ssh\id_boot2docker
@willemdh Ah, that's another way of doing it.
Thanks Marti! And good job on the Cmder. I'm using it alot. THe only other issue I still have is this https://github.com/bliker/cmder/issues/379
Any ideas? :)
@MartiUK I'm having the same issue but with BitBucket. In Git Bash, I only have to input my password once, then I can git pull and git push as many times as I want without the need of a password. But on Cmder, each time I do a remote git command, it asks for the bitbucket password!
My .ssh folder sits here C:\Users\jkhalaf\.ssh and in the config file I have:
Host bitbucket.org
IdentityFile C:\Users\jkhalaf\.ssh\id_rsa
Any ideas?
@Ciwan1859 Have you added the key to the ssh-agent?
@MartiUK, yep I have. I tried to do it again in Cmder, but I got the following:

But in Git Bash, it was added fine!

Afterwards, I restarted Cmder, but again it asks for the password on each remote git command.
try this: C:\\Users\\Willem\.ssh\\id_rsa
double back slash
Most helpful comment
By default msysgit uses
%HOME%\.sshSo In your case that would be
C:\Users\Willem\.ssh