using ssh from Git for Windows in a stand-alone fashion

0

I am having Git for Windows (this comes with MinGw64 binaries and an msys-dll set) and have extracted (thanks to depends.exe) only the program SSH.exe with the needed DLL files for using those application in a stand-alone fashion.

First i tried everything out in the standard shell that gets launched by "git-bash.exe" (it gets headlined MinGw64) and seems to establish a small Linux alike tty based terminal /home/ landscape with seemingly bash running. here anything went fine and ssh.exe did serve me well.

when launching only ssh.exe from e.g. a fresh cmd.exe prompt or similar i got outputs like this (with a little interaction where i had to answer yes; with some obfuscation for evident reasons):

C:\temp\ssh>ssh.exe <server>
Could not create directory '/home/<user>/.ssh'.
The authenticity of host '<server> (10.***.***.***)' can't be established.
ECDSA key fingerprint is SHA256:***/***.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/<user>/.ssh/known_hosts).
Permission denied (publickey).

C:\temp\ssh>

What needs to be done in order to run this variant of "ssh" stand-alone from cmd.exe so that i can reach my networking target?

Alexander Stohr

Posted 2017-09-04T12:25:42.423

Reputation: 25

Answers

1

Solved it:

C:\temp\ssh>ssh.exe -i c:/users/<user>/.ssh/id_rsa  -o UserKnownHostsFile=c:/users/<user>/.ssh/known_hosts <server>
Could not create directory '/home/<user>/.ssh'.
Last login: Mon Sep  4 13:32:03 2017 from <client>
<user>@<server>:~$ exit
logout
Connection to <server> closed.

C:\temp\ssh>

Alexander Stohr

Posted 2017-09-04T12:25:42.423

Reputation: 25