Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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
Provisioning 在使用Itamae时可以使用ssh配置名称吗_Provisioning_Itamae - Fatal编程技术网

Provisioning 在使用Itamae时可以使用ssh配置名称吗

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的命令如下:

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