Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git ssh_askpass:exec(/usr/bin/ssh-askpass):没有被拒绝的文件或目录权限,请重试_Git_Bitbucket_Autodeploy - Fatal编程技术网

Git ssh_askpass:exec(/usr/bin/ssh-askpass):没有被拒绝的文件或目录权限,请重试

Git ssh_askpass:exec(/usr/bin/ssh-askpass):没有被拒绝的文件或目录权限,请重试,git,bitbucket,autodeploy,Git,Bitbucket,Autodeploy,我想在Bitbucket上运行pipline。我做了所有必要的设置。我安装了ssh_askpass。我正在使用Ubuntu18 然而,我得到下面的错误 ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory Permission denied, please try again. 我的bitbucket-pipelines.yml文件: pipelines: default: - step:

我想在Bitbucket上运行pipline。我做了所有必要的设置。我安装了ssh_askpass。我正在使用Ubuntu18

然而,我得到下面的错误

ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Permission denied, please try again.
我的bitbucket-pipelines.yml文件:

pipelines:
  default:
    - step:
        deployment: staging
        caches:
          - composer
        script:
          - ssh -T root@142.93.143.146
          - eval `ssh-agent -s` && ssh-add ~/.ssh/id_rsa && ssh-add -l
          - cd /var/www/backoffice/
          - git checkout master 
          - git pull origin master 
          - sudo php artisan optimize 
          - sudo composer dump-autoload
          - echo 'Deploy finished....'

您将无法在CI系统上使用任何类型的GUI程序,如
ssh askpass
,因为在Linux CI系统上没有可用的GUI

如果要在CI系统中使用SSH密钥,应使用未设置密码的密钥,并将其存储在CI系统的机密存储中,然后将其复制到文件并使用。OpenSSH故意不提供以编程方式读取密码的方法

请注意,如果只有一个SSH密钥没有密码,则根本不需要
SSH代理
SSH添加
。假设您的私钥内容在变量
SSH\u key
中(例如,由于您的CI系统的秘密存储),您只需执行以下操作:

echo "$SSH_KEY" > ~/.ssh/id_rsa
ssh root@142.93.143.146 'echo hello from the remote machine`
您不希望在没有命令的情况下运行
ssh
,因为这将尝试启动一个交互式会话,这对您没有用处。如果您的目标是使用Git推拉SSH连接,那么您根本不需要运行
SSH

最后,请注意,您可能希望将远程系统的主机密钥信息作为管道的一部分从管道或机密写入文件,因为如果主机密钥不受信任,SSH将无法连接。您可以通过运行如下命令来获取此信息:
ssh keyscan github.com 2>/dev/null
。然后,您可以获取该输出并将其插入到
已知的\u hosts
文件中,如下所示:

echo "github.com ssh-rsa AAAA...truncated" > ~/.ssh/known_hosts

这比关闭严格的主机密钥检查要安全得多。

您想实现什么?IIRC、ssh-askpass面向GUI用户,因此他们可以以更友好的方式输入密码。我不确定这对你的所作所为是否有意义。如果有的话,您似乎应该使用ssh的authorized_keys文件来帮助部署。更好的办法是有一些听者,可以得到提示并进行部署,但你可能无法得到你想要的所有反馈。谢谢你的回答。我不知道为什么要用“ssh_askpass”。我用的是比特桶。推完后,我想请求拉。我仍然得到错误。我在网上找不到一个严肃的答案。这是一个完全不同的问题,所以请用一个新的问题来回答。在评论中我可能没有空间回答这个问题。