1

I am using Keepass 2 to store my SSH login credentials. Keepass has the ability to run commands and insert usernames, passwords, etc. into that command, so you can click on a web site credential and have it open that page in a browser.

http://keepass.info/help/base/autourl.html

I'd like to do that with my SSH logins. In ConEmu, I'm running Git Bash, which includes the OpenSSH command line client. I'd like to have Keepass run a command which opens a new terminal in ConEmu, and starts SSH, passing in the IP, user, and password from the KeePass database.

ConEmu has a lot of handy command line switches:

https://code.google.com/p/conemu-maximus5/wiki/Command_Line

But I can't figure out how to make those switches open a terminal and run ssh. Here's my attempt:

ConEmu64.exe /cmd "%ProgramFiles(x86)%\Git\bin\sh.exe" --login -i "ssh [email protected]"

But these are the results I get:

Welcome to Git (version 1.9.4-preview20140611)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
sh.exe": ssh [email protected]: No such file or directory


Current directory:
C:\Program Files\ConEmu\ConEmu

Command to be executed:
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i "ssh [email protected]"


ConEmuC: Root process was alive less than 10 sec, ExitCode=127.
Press Enter or Esc to close console...

I tried a couple variations, but didn't get any closer. It seems clear to me that I do not properly understand how the ConEmu command line switches, or how to pass a command into my Git Bash session. Any tips will be much appreciated.

1 Answer 1

2

Nothing to do with ConEmu switches. The error is showing by "git"! You need to examining its (sh.exe) switches!

ConEmu64.exe /cmd "%ProgramFiles(x86)%\Git\bin\sh.exe" --login -i -c "ssh [email protected]"
1
  • Exactly what I needed, thanks. The nesting of having ConEmu call, Git Bash, which called ssh was a bit much for me, and I got a little confused. I couldn't understand why bash would see the 'Command to be executed' as having its own path. But I'm guessing the first 4 lines were Bash output, and the last 6 were ConEmu output? At any rate, adding the -c fixed it, and now I can use KeePass to start SSH sessions in ConEmu by simply hitting Ctrl + U. Love it!!! Commented Jul 13, 2014 at 22:57

You must log in to answer this question.

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