【问题标题】:rstudio push 'rpostback-askpass' errorrstudio push 'rpostback-askpass' 错误
【发布时间】:2015-12-18 10:17:32
【问题描述】:

从 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


【解决方案1】:

问题在于 RStudio 中最新的 https 身份验证。 (如this post 中所述)

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

然后,别忘了在 github 上设置公钥(Your Profile->Settings->SSH Keys 解释为here

【讨论】:

    【解决方案2】:

    解决方案是将密码添加到 .ssh 目录中的“id_rsa”。这就是我的情况。我正在使用 Linux 服务器。

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

    步骤如下:

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

     $ ssh -vT git@github.com
        # ...
        # 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 步: $init 6

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

    归功于此链接:https://help.github.com/articles/error-agent-admitted-failure-to-sign/

    【讨论】:

      【解决方案3】:

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

      【讨论】:

      • 请在此处发布链接网页的相关部分。链接会随着时间的推移而消失,因此此处不欢迎仅提供链接的答案。
      【解决方案4】:

      从 git 1.9.1 开始,您的 $HOME/.gitconfig 文件应如下所示:

      [credential]
              helper = cache --timeout=3600
      

      【讨论】:

        【解决方案5】:

        我是从 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
        

        【讨论】:

          【解决方案6】:

          当 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 -&gt; Shell。在您的 RProject 目录中打开一个 shell 窗口。输入git push,git 会询问你的用户名和密码。

          这背后的原因是 Git 会在 shell 中询问你的密码,并在你在--timeout=xxxx 中设置的时间将其存储在缓存中。

          现在您可以在 RStudio 中使用 push / pull 按钮。

          【讨论】:

            猜你喜欢
            • 2023-01-13
            • 1970-01-01
            • 2017-06-08
            • 1970-01-01
            • 2017-02-23
            • 2015-05-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多