rstudio 推送“rpostback-askpass”错误

问题描述 投票:0回答:6

从 CLI,我可以推送/拉取到 git。然而,在 Rsudio 中,我只能拉,不能推。我已打开 ssh/https 端口的防火墙 但我在尝试推送时仍然收到以下错误:

error: unable to read askpass response from 'rpostback-askpass'
fatal: could not read Username for 'https://github.com': No such device or address

Rstudio 版本 0.99.484。

git rstudio ssh-keys
6个回答
10
投票

问题出在 RStudio 中最新的 https 身份验证中。 (正如这篇文章中所解释的)

解决方案是通过在项目中编辑存储库的配置来将存储库 URL 从 https 切换为 ssh:.git/config

然后,不要忘记在 github 上设置公钥(您的个人资料 -> 设置 -> SSH 密钥,如此处所述)


0
投票

解决方案是将密码添加到位于 .ssh 目录中的“id_rsa”中。这就是对我的案例起作用的。我使用 Linux 服务器。

~/.ssh$ ls
**id_rsa  id_rsa.pub  known_hosts

步骤如下:

第 1 步:当您尝试从 CLI 进行 ssh 时您会看到什么

 $ ssh -vT [email protected]
    # ...
    # Agent admitted failure to sign using the key.
    # debug1: No more authentication methods to try.
    # Permission denied (publickey).

第2步: 在后台启动 ssh-agent

eval "$(ssh-agent -s)"
# Agent pid 59566
ssh-add
# Enter passphrase for /home/you/.ssh/id_rsa: ***TYPE YOUR PASSPHRASE HERE***
# Identity added: /home/you/.ssh/id_rsa (/home/you/.ssh/id_rsa)

第3步: $初始化 6 <-----reboot your linux server

现在,我可以从 Rstudio 推送/拉取!

信用转到此链接:https://help.github.com/articles/error-agent-admited-failure-to-sign/


0
投票

从 git 1.9.1 开始,您的

$HOME/.gitconfig
文件应如下所示:

[credential]
        helper = cache --timeout=3600

0
投票

我从 RStudio 服务器笔记本上看到了这一点:

git push
error: cannot run rpostback-askpass: No such file or directory
Username for 'https://stash.mycompany.org':

注意最后一行要求输入用户名(例如

smithj
或任何您的 git/stash 用户名 - 它可能是电子邮件地址)。只需输入用户名即可。

然后它可能会要求输入密码,也给它密码,你就可以开始了。

注意:由于相关原因,我必须重新安装askpass,并这样做:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openssh-client

0
投票

我在使用新的 github 存储库时遇到了这个问题,并且设置公共 SSH 密钥(如 Viliam Simko 链接)并没有解决它。按照 daattalli here 的建议从命令行推送就成功了,一劳永逸。

这个想法是第一次使用命令行推送,当您从命令行推送时,它会询问您的凭据,之后您应该能够使用 RStudio 按钮进行推送,并且您将不需要再次使用命令行。

  • 在 RStudio 中,单击“工具”菜单并选择“Shell”
  • 运行以下命令:git push -u origin master
  • 它可能会要求您提供 git 用户名和密码。提供此信息,确保其正确
  • 希望推送成功,然后就可以关闭窗口了
  • 现在对某些文件进行更多编辑,以便您可以推送新内容
  • 单击 RStudio 中的“推送”按钮,这次推送应该可以工作

-1
投票

当 Git 没有将我的密码存储在缓存中时,我总是会收到此错误。

要设置 git 以存储您的密码,只需在 git 设置中输入

credential.helper=cache --timeout=3600
,如下所示:

git config --global --set credential.helper 'cache --timeout=3600'

(请注意,此行适用于 Linux,对于其他操作系统略有不同。)

在默认 shell 中使用

git config -l
检查您的 Git 设置,他们应该喜欢这样(+ 下面的附加行):

user.email=<your.mail>
user.name=<your.username>
credential.helper=cache --timeout=3600

现在,当您第一次从 Github 存储库中拉取/推送某些内容时,您必须使用 shell。只需在 RStudio 中单击

Tools -> Shell
。在 RProject 的目录中将打开一个 shell 窗口。输入
git push
,git 会询问你的用户名和密码。

其背后的原因是,Git 会在 shell 中询问您的密码,并将其存储在缓存中,时间您在

--timeout=xxxx
中设置。

现在您可以使用 RStudio 中的

push / pull
按钮。

© www.soinside.com 2019 - 2024. All rights reserved.