
我正在使用 Keepass 2 來儲存我的 SSH 登入憑證。 Keepass 能夠執行命令並將使用者名稱、密碼等插入到該命令中,因此您可以點擊網站憑證並讓它在瀏覽器中開啟該頁面。
http://keepass.info/help/base/autourl.html
我想透過 SSH 登入來做到這一點。在 ConEmu 中,我運行 Git Bash,其中包括 OpenSSH 命令列客戶端。我想讓 Keepass 執行一個命令,在 ConEmu 中開啟一個新終端,並啟動 SSH,傳入 KeePass 資料庫中的 IP、使用者和密碼。
ConEmu 有很多方便的命令列開關:
https://code.google.com/p/conemu-maximus5/wiki/Command_Line
但我不知道如何讓這些開關打開終端並運行 ssh。這是我的嘗試:
ConEmu64.exe /cmd "%ProgramFiles(x86)%\Git\bin\sh.exe" --login -i "ssh [email protected]"
但這些是我得到的結果:
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...
我嘗試了幾種變體,但沒有更接近。我似乎很清楚,我沒有正確理解 ConEmu 命令列如何切換,或者如何將命令傳遞到我的 Git Bash 會話中。任何提示將不勝感激。
答案1
與 ConEmu 開關無關。錯誤由“git”顯示!您需要檢查它的 ( sh.exe
) 開關!
ConEmu64.exe /cmd "%ProgramFiles(x86)%\Git\bin\sh.exe" --login -i -c "ssh [email protected]"