【发布时间】:2017-06-01 15:40:18
【问题描述】:
我正在尝试在部署厨师食谱之前运行我的所有检查测试。我想知道我的实例的初始状态是什么。
我测试了 ssh 连接:
ssh -i $HOME/key.pem centos@server_ip_address
并且连接是允许的,但是当我尝试再次运行检查测试时,服务器:
inspec exec ntp/test/integration/ntp.rb -t ssh://centos@server_ip_address -i /home/centos/key.pem
我收到了这个错误:
I, [2017-01-17T14:10:32.835995 #2416] INFO -- : [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user centos@server_ip_address>)
I, [2017-01-17T14:10:34.619150 #2416] INFO -- : [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user centos@server_ip_address>)
I, [2017-01-17T14:10:36.403860 #2416] INFO -- : [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user centos@server_ip_address>)
I, [2017-01-17T14:10:38.188401 #2416] INFO -- : [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user centos@server_ip_address>)
W, [2017-01-17T14:10:39.971832 #2416] WARN -- : [SSH] connection failed, terminating (#<Net::SSH::AuthenticationFailed: Authentication failed for user centos@server_ip_address>)
Transport error, can't connect to 'ssh' backend: SSH session could not be established
我不知道错误在哪里。有什么建议吗?
检查信息
chef gem list | grep inspec
inspec (1.9.0, 1.7.2)
【问题讨论】:
-
我假设 key as hostname 是一个错字 (
-t ssh://centos@key) 或者不是?服务器日志中是否有任何内容? -
您应该在检查中查看 train gem。这是造成问题的原因。
标签: ssh ssh-keys openssh inspec