【问题标题】:Azure CLI: I dont handle protocolAzure CLI:我不处理协议
【发布时间】:2019-05-23 17:54:35
【问题描述】:

我正在尝试从私人仓库安装文件。我正在使用 azure cli run 命令来调用这些操作。

运行命令如下所示:

az vm run-command invoke --name ${MONITOR_VM_NAME} \
            --command-id RunShellScript \
            --resource-group ${RSC_GRP_NAME} \
            --scripts "
                        curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash 
                        sudo yum -y install nodejs
                        cd /etc/
                        sudo git clone \${REPO_USER_NAME}:\${REPO_PASSWORD}@https://bar.visualstudio.com/Foo/_git/Eth-Netstats

           "

不幸的是,我在输出中收到了这个:

致命:我不处理协议 ':@https'

我看过这里:

https://github.com/brackets-userland/brackets-git/issues/965

git: fatal: I don't handle protocol '​​http'

但它似乎没有帮助。我会很感激这方面的任何指示

【问题讨论】:

  • 将文字用户名和密码编码为httphttps URL 的语法为:https://user:password@host.example.com/text?passed&to=host。也就是说,user:password 部分 https:// 部分之后,在主机名之前。
  • 谢谢我这么傻。请添加为答案,以便我接受它

标签: git azure-cli


【解决方案1】:

将文字用户名和密码编码为httphttps URL 的语法为:https://<em>user</em>:<em>password</em>@host.example.com/text?passed&amp;to=host。也就是说,<em>user</em>:<em>password</em> 部分在 https:// 部分之后,在主机名之前。

(以上内容是从评论中移来的,并进行了一些格式化。)

请注意,ssh URL 可以使用类似的形式:ssh://user:password@host.example.com/...,尽管在 ssh URL 中包含明文密码会更糟糕,因为 ssh 很难防止明文密码。 (明文密码在任何地方都是个坏主意,但至少在使用 https 时,人们有理由认为该领域的标准化程度较低。)但 Git 有一种特殊的形式,将 user@host:... 识别为 ssh://user@host/... 的简写。

除此之外:我在上面表达的安全问题完全被排除在外:

curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash

我意识到这是人们用来安装 nodejs 的标准方式(访问https://rpm.nodesource.com/setup_10.x 以查看)。我只是希望不是。

【讨论】:

    猜你喜欢
    • 2016-05-22
    • 2017-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-30
    • 1970-01-01
    • 2018-12-27
    相关资源
    最近更新 更多