# Knife ssh Return Values

**URL:** <https://discourse.chef.io/t/knife-ssh-return-values/4017>\
**Category:** Chef Infra (archive)\
**Created:** [May 26, 2013, 1:10pm UTC](https://discourse.chef.io/t/knife-ssh-return-values/4017 "2013-05-26T13:10:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Tewner](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Mike\_Tewner](https://discourse.chef.io/u/Mike_Tewner)\
**Post date:** [May 26, 2013, 1:10pm UTC](https://discourse.chef.io/t/knife-ssh-return-values/4017/1 "2013-05-26T13:10:05Z")

</div>

Hi Guys!

We’re using “knife ssh” to deploy parts of our application. It seems,  
though, that knife ssh returns “0” if it can’t connect to the host:

user@chef02:/tmp$ knife ssh ‘name:MikeEnv01C1’ 'ls /etc’  
MikeEnv01C1 fstab makedev.d rmt  
.  
.  
.  
user@chef02:/tmp$ echo $?  
0

… and to a host which was brought down:

user@chef02:/tmp$ knife ssh ‘name:SteveEnv02C’ ‘ls /etc’

echo ? WARNING: Failed to connect to -- Errno::ETIMEDOUT: Connection timed out - connect(2) user@chef02:/tmp echo $?  
0

user@chef02:/tmp$ knife -v  
Chef: 11.4.0

Is this “As Designed”?

-Mike

–

_This email and any files transmitted with it are confidential and intended  
solely for the use of the individual or entity to whom they are  
addressed. Please note that any disclosure, copying or distribution of the  
content of this information is strictly forbidden. If you have received  
this email message in error, please destroy it immediately and notify its  
sender._\*\*
