Provisioning 在使用Itamae时可以使用ssh配置名称吗
我使用Itamae的命令如下:Provisioning 在使用Itamae时可以使用ssh配置名称吗,provisioning,itamae,Provisioning,Itamae,我使用Itamae的命令如下: itamae ssh -u ironsand -h xxx.xxx.xxx.xxx cookbooks/user.rb ssh配置以名称my\u ssh\u config保存。 我可以使用ssh配置名称作为itamae ssh的参数吗 我的~/.ssh/config 截至3月30日,对使用ssh配置主机的支持已并入itamae的主分支: 因此,只要您使用的是itamae的最新副本,就应该支持此功能: itamae ssh -h my_ssh_config co
itamae ssh -u ironsand -h xxx.xxx.xxx.xxx cookbooks/user.rb
ssh配置以名称my\u ssh\u config
保存。
我可以使用ssh配置名称作为itamae ssh
的参数吗
我的~/.ssh/config
截至3月30日,对使用ssh配置主机的支持已并入itamae的主分支: 因此,只要您使用的是itamae的最新副本,就应该支持此功能:
itamae ssh -h my_ssh_config cookbooks/user.rb
或
您可能还需要在命令行上使用-i
选项指定密钥文件:
itamae ssh --host=my_ssh_config -i ~/.ssh/my_ssh_host.key cookbooks/user.rb
或者使用ssh配置中的IdentityFile
节:
Host my_ssh_config
HostName xxx.xxx.xxx.xxx
User ironsand
IdentityFile ~/.ssh/my_ssh_host.key
您的意思是使用主机别名吗?例如,在ssh配置中,是否有如下行:Host alias1 alias2;主机名xxx.xxx.xxx.xxx,您想使用-h alias1而不是-h xxx.xxx.xxx.xxx?是的,主机别名和用户名也是。就像我通过
ssh my\u ssh\u config
连接服务器一样。
itamae ssh --host=my_ssh_config -i ~/.ssh/my_ssh_host.key cookbooks/user.rb
Host my_ssh_config
HostName xxx.xxx.xxx.xxx
User ironsand
IdentityFile ~/.ssh/my_ssh_host.key