Chef infra 如何在Vagrantbox上使用Chef solo设置部署用户?

Chef infra 如何在Vagrantbox上使用Chef solo设置部署用户?,chef-infra,vagrant,Chef Infra,Vagrant,在我的档案中,我有: config.vm.network :hostonly, "192.168.1.20" 现在,我如何设置我的用户以便 ssh deploy@192.168.1.20 开箱即用?(=在vagrant up之后,使用Chef solo provisioning?您需要通过托管vagrantbox的机器的IP通过ssh连接到vagrantbox。但是您使用的端口号与标准ssh端口22不同。通常,vagrant会将vagrant box的ssh端口22向前设置到主机的端口

在我的档案中,我有:

  config.vm.network :hostonly, "192.168.1.20"
现在,我如何设置我的用户以便

ssh  deploy@192.168.1.20

开箱即用?(=在
vagrant up
之后,使用Chef solo provisioning?

您需要通过托管vagrantbox的机器的IP通过ssh连接到vagrantbox。但是您使用的端口号与标准ssh端口22不同。通常,vagrant会将vagrant box的ssh端口22向前设置到主机的端口2222

ssh -p 2222 deploy@localhost


谢谢很抱歉,如果我的问题不够准确,但是这部分:“在您的一本食谱中创建部署用户”是我的问题;我正在寻找一种简单的方法来创建部署用户,然后可以将其与ssh一起使用
ssh -p 2222 deploy@<port of your host machine>
user "deploy" do
 comment "Deploy User"
 uid 1000
 gid "users"
 home "/home/deploy"
 shell "/bin/sh"
 password "$1$JJsvHslV$szsCjVEroftprNn4JHtDi."
end