git - ssh-keygen 没有找到 ssh_askpass

标签 git ssh

我正在尝试在 Windows 上为 Git 生成 SSH key (我刚刚安装了 2.18.0),但它没有找到名为 ssh_askpass 的东西:

d:\src\py\>ssh-keygen -b 4096 -C my.email@dot.com
Generating public/private rsa key pair.
Enter file in which to save the key (/d//.ssh/id_rsa): D:\.ssh\id_rsa_new
ssh_askpass: exec(/usr/lib/ssh/ssh-askpass): No such file or directory
ssh_askpass: exec(/usr/lib/ssh/ssh-askpass): No such file or directory
.
.pub.

ssh-keygen 二进制文件是 git 附带的二进制文件,位于 C:\Program Files\Git\usr\bin 中,但该目录没有 ssh_askpass 文件。

我在哪里可以得到这个“ssh_askpass”?找不到的后果是什么?

最佳答案

回答我自己的问题,为了可能偶然发现此问题的其他人的利益,现在我真的明白发生了什么:这个命令是在 emacs 子shell 中输入的,它没有完整的终端功能(它被认为是一个“哑”终端)。

然后 ssh-keygen 认为它不是在终端内运行,因此无法读取密码,并尝试运行 X Window 程序,但由于这是 Windows 而失败。

解决方案是在 Git Bash 中或在 Windows 命令行工具中运行 ssh-keygen(或 ssh-add),在那里它将能够提示输入密码,并按预期工作。

关于git - ssh-keygen 没有找到 ssh_askpass,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51866922/

相关文章:

ssh - SSH 目标端口和源端口是否相同(对称端口)?

ssh - 如何使用 Ansible 设置 SSH 连接?

node.js - npm 安装带有自定义更改的 fork 存储库不会 `build` 模块

git - 带有 -a 的路径对 bash 函数没有意义

python - 如何在 GIT 中处理 python 模块

windows - 在 ubuntu 12.04 中设置 git-core、gitolite 和 gitweb 并在 git 客户端不工作时添加 windows 机器

git - GitHub 是否会收集 pull 请求中引用的悬空提交?

php - Smartgit 总是要求输入密码凭据

ruby net-ssh 登录 shell

git - 访问不同ip或host时如何指定不同的git账号?