我能够通过GitBash使用ssh(例如,与Heroku或GitHub等一起使用'git'),但是我无法在同一台计算机上从Windows cmd提示符中执行相同操作。可能的问题是什么?如果我记得正确,以前可以从cmd提示符中工作。
我收到的错误消息是:
我收到的错误消息是:
Permission denied (publickey). fatal: The remote end hung up unexpectedly
我已经获取了两个日志文件:以下是cmd中与“git bash”不同的最后四行:
debug1: Trying private key: /.ssh/identity
debug1: Trying private key: /.ssh/id_rsa
debug1: Trying private key: /.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
如果使用Git bash,则相应的行为:
debug1: Trying private key: /c/Users/user1/.ssh/identity
debug1: Offering public key: /c/Users/user1/.ssh/id_rsa
debug1: Remote: Forced command: gerve user1
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
已解决
正如@snemarch所提示的,设置以下环境变量解决了我的问题:
set HOME=C:\Users\user1