在完成对Ubuntu的配置后,我有一个脚本来安装来自不同存储库的所有依赖项和两个项目。但是我的git克隆人失败了
Cloning into 'frontend'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists. 但是当我在SSH做我的git clone时,它工作得很完美.在使用以下命令进行克隆之前,我在配置文件中取消了StrictHostKeyChecking:
echo -e "Host *" >> /home/vagrant/.ssh/config
echo -e "\tStrictHostKeyChecking no" >> /home/vagrant/.ssh/config为什么git克隆在脚本中失败而不是在SSH中失败?我如何解决我的问题?
编辑:正如所问的,我的流浪档案:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-17.04"
config.vm.network "private_network", ip: "192.168.50.5"
config.vm.synced_folder "./../projects", "/home/vagrant/projects"
config.vm.provider "virtualbox" do |v|
v.name = "devOS"
end
config.vm.provision "shell", path: "./configure"
end发布于 2017-10-19 18:40:38
因此,您的配置脚本作为root运行,但是您已经更新了您的流浪用户的文件,当您使用ssh时,这些文件将很好地工作。
您想要的是以流浪用户的身份运行脚本,并且需要特权选择权。
privileged(布尔值)-指定是否以特权用户的身份执行shell脚本(sudo)。默认情况下,这是“真”。
编辑Vagrantfile并更改
config.vm.provision "shell", path: "./configure", privileged: falsehttps://stackoverflow.com/questions/46835728
复制相似问题