# Knife ssh not working

**URL:** <https://discourse.chef.io/t/knife-ssh-not-working/6145>\
**Category:** Chef Infra (archive)\
**Created:** [December 1, 2014, 5:57pm UTC](https://discourse.chef.io/t/knife-ssh-not-working/6145 "2014-12-01T17:57:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kritivagop01](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kritivagop01](https://discourse.chef.io/u/kritivagop01)\
**Post date:** [December 1, 2014, 5:57pm UTC](https://discourse.chef.io/t/knife-ssh-not-working/6145/1 "2014-12-01T17:57:10Z")

</div>

hi,

i am getting error for knife ssh command.

FATAL: 1 node found, but does not have the required attribute to establish  
the connection. Try setting another attribute to open the connection using  
–attribute.

please share the details for knife.rb

thanks,  
K.Gopalakrishnan

---

<div class="post-metadata">

**Author:** ![Nico\_Kadel\_Garcia](https://avatars.discourse-cdn.com/v4/letter/n/ad7895/32.png) [@Nico\_Kadel\_Garcia](https://discourse.chef.io/u/Nico_Kadel_Garcia)\
**Post date:** [December 1, 2014, 10:04pm UTC](https://discourse.chef.io/t/knife-ssh-not-working/6145/2 "2014-12-01T22:04:11Z")

</div>

If your DNS is not fully configured for the node in question, you may need to use “-a ipaddress” in order to connect on that basis. I’ve run into that.

Nico Kadel-Garcia  
Lead DevOps Engineer  
[nkadel@skyhookwireless.com](mailto:nkadel@skyhookwireless.com)[mailto:nkadel@skyhookwireless.com](mailto:nkadel@skyhookwireless.com)

From: kritivagop01 . [[mailto:krithiva.gopal@gmail.com](mailto:krithiva.gopal@gmail.com)]  
Sent: Monday, December 01, 2014 12:57 PM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] knife ssh not working

hi,

i am getting error for knife ssh command.

FATAL: 1 node found, but does not have the required attribute to establish the connection. Try setting another attribute to open the connection using --attribute.

please share the details for knife.rb

thanks,  
K.Gopalakrishnan

---

<div class="post-metadata">

**Author:** ![kritivagop01](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kritivagop01](https://discourse.chef.io/u/kritivagop01)\
**Post date:** [December 2, 2014, 6:13am UTC](https://discourse.chef.io/t/knife-ssh-not-working/6145/3 "2014-12-02T06:13:08Z")

</div>

hi,

i am able to search using :

[root@localhost chef-repo]# knife search 'name:newclient'  
1 items found

Node Name: newclient  
Environment: \_default  
FQDN: [newclient.domain.com](http://newclient.domain.com)  
IP: 192.168.142.152  
Run List: recipe[push-jobs], recipe[snmp]  
Roles:  
Recipes: push-jobs, snmp, push-jobs::default, push-jobs::linux,  
push-jobs::config, push-jobs::service, runit::default,  
build-essential::default, build-essential::\_rhel, snmp::default  
Platform: centos 6.6  
Tags:

[root@localhost chef-repo]# knife ssh "platform:centos 6.6" -a  
192.168.142.152 "ls /tmp"  
FATAL: 2 nodes found, but does not have the required attribute to establish  
the connection. Try setting another attribute to open the connection using  
--attribute.

dns setting is done and able to ping with that.

[root@localhost chef-repo]# ping newclient  
PING [newclient.domain.com](http://newclient.domain.com) (192.168.142.152) 56(84) bytes of data.  
64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=1 ttl=64  
time=1.14 ms  
64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=2 ttl=64  
time=0.339 ms  
64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=3 ttl=64  
time=0.448 ms  
64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=4 ttl=64  
time=0.396 ms

On Tue, Dec 2, 2014 at 3:34 AM, Nico Kadel-Garcia \<  
[nkadel@skyhookwireless.com](mailto:nkadel@skyhookwireless.com)\> wrote:

> If your DNS is not fully configured for the node in question, you may  
> need to use “-a ipaddress” in order to connect on that basis. I’ve run into  
> that.
> 
> Nico Kadel-Garcia
> 
> Lead DevOps Engineer
> 
> [nkadel@skyhookwireless.com](mailto:nkadel@skyhookwireless.com)
> 
> _From:_ kritivagop01 . [[mailto:krithiva.gopal@gmail.com](mailto:krithiva.gopal@gmail.com)]  
> _Sent:_ Monday, December 01, 2014 12:57 PM  
> _To:_ [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> _Subject:_ [chef] knife ssh not working
> 
> hi,
> 
> i am getting error for knife ssh command.
> 
> FATAL: 1 node found, but does not have the required attribute to establish  
> the connection. Try setting another attribute to open the connection using  
> --attribute.
> 
> please share the details for knife.rb
> 
> thanks,
> 
> K.Gopalakrishnan

---

<div class="post-metadata">

**Author:** ![jdunn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jdunn/32/1800_2.png) [@jdunn](https://discourse.chef.io/u/jdunn)\
**Post date:** [December 2, 2014, 7:31am UTC](https://discourse.chef.io/t/knife-ssh-not-working/6145/4 "2014-12-02T07:31:02Z")

</div>

Use the actual string "-a ipaddress" (not substituting the IP address  
of the box).

- Julian

On Tue, Dec 2, 2014 at 1:13 AM, kritivagop01 . [krithiva.gopal@gmail.com](mailto:krithiva.gopal@gmail.com) wrote:

> hi,
> 
> i am able to search using :
> 
> [root@localhost chef-repo]# knife search 'name:newclient'  
> 1 items found
> 
> Node Name: newclient  
> Environment: \_default  
> FQDN: [newclient.domain.com](http://newclient.domain.com)  
> IP: 192.168.142.152  
> Run List: recipe[push-jobs], recipe[snmp]  
> Roles:  
> Recipes: push-jobs, snmp, push-jobs::default, push-jobs::linux,  
> push-jobs::config, push-jobs::service, runit::default,  
> build-essential::default, build-essential::\_rhel, snmp::default  
> Platform: centos 6.6  
> Tags:
> 
> [root@localhost chef-repo]# knife ssh "platform:centos 6.6" -a  
> 192.168.142.152 "ls /tmp"  
> FATAL: 2 nodes found, but does not have the required attribute to establish  
> the connection. Try setting another attribute to open the connection using  
> --attribute.
> 
> dns setting is done and able to ping with that.
> 
> [root@localhost chef-repo]# ping newclient  
> PING [newclient.domain.com](http://newclient.domain.com) (192.168.142.152) 56(84) bytes of data.  
> 64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=1 ttl=64  
> time=1.14 ms  
> 64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=2 ttl=64  
> time=0.339 ms  
> 64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=3 ttl=64  
> time=0.448 ms  
> 64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=4 ttl=64  
> time=0.396 ms
> 
> On Tue, Dec 2, 2014 at 3:34 AM, Nico Kadel-Garcia  
> [nkadel@skyhookwireless.com](mailto:nkadel@skyhookwireless.com) wrote:
> 
> > If your DNS is not fully configured for the node in question, you may  
> > need to use “-a ipaddress” in order to connect on that basis. I’ve run into  
> > that.
> > 
> > Nico Kadel-Garcia
> > 
> > Lead DevOps Engineer
> > 
> > [nkadel@skyhookwireless.com](mailto:nkadel@skyhookwireless.com)
> > 
> > From: kritivagop01 . [[mailto:krithiva.gopal@gmail.com](mailto:krithiva.gopal@gmail.com)]  
> > Sent: Monday, December 01, 2014 12:57 PM  
> > To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> > Subject: [chef] knife ssh not working
> > 
> > hi,
> > 
> > i am getting error for knife ssh command.
> > 
> > FATAL: 1 node found, but does not have the required attribute to establish  
> > the connection. Try setting another attribute to open the connection using  
> > --attribute.
> > 
> > please share the details for knife.rb
> > 
> > thanks,
> > 
> > K.Gopalakrishnan

--  
[Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) \* Sorry, I'm ]  
[WWW: [Julian Dunn's Blog - Commentary on media, technology, and everything in between.](http://www.aquezada.com/staff/julian) \* only Web 1.0 ]  
[gopher://sdf.org/1/users/keymaker/ \* compliant!]  
[PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9]

---

<div class="post-metadata">

**Author:** ![kritivagop01](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kritivagop01](https://discourse.chef.io/u/kritivagop01)\
**Post date:** [December 2, 2014, 7:45am UTC](https://discourse.chef.io/t/knife-ssh-not-working/6145/5 "2014-12-02T07:45:53Z")

</div>

thanks ,

it is working fine now with -a ipaddress.

rgs  
K.Gopalakrishnan

On Tue, Dec 2, 2014 at 1:01 PM, Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) wrote:

> Use the actual string "-a ipaddress" (not substituting the IP address  
> of the box).
> 
> - Julian
> 
> On Tue, Dec 2, 2014 at 1:13 AM, kritivagop01 . [krithiva.gopal@gmail.com](mailto:krithiva.gopal@gmail.com)  
> wrote:
> 
> > hi,
> > 
> > i am able to search using :
> > 
> > [root@localhost chef-repo]# knife search 'name:newclient'  
> > 1 items found
> > 
> > Node Name: newclient  
> > Environment: \_default  
> > FQDN: [newclient.domain.com](http://newclient.domain.com)  
> > IP: 192.168.142.152  
> > Run List: recipe[push-jobs], recipe[snmp]  
> > Roles:  
> > Recipes: push-jobs, snmp, push-jobs::default, push-jobs::linux,  
> > push-jobs::config, push-jobs::service, runit::default,  
> > build-essential::default, build-essential::\_rhel, snmp::default  
> > Platform: centos 6.6  
> > Tags:
> > 
> > [root@localhost chef-repo]# knife ssh "platform:centos 6.6" -a  
> > 192.168.142.152 "ls /tmp"  
> > FATAL: 2 nodes found, but does not have the required attribute to  
> > establish  
> > the connection. Try setting another attribute to open the connection  
> > using  
> > --attribute.
> > 
> > dns setting is done and able to ping with that.
> > 
> > [root@localhost chef-repo]# ping newclient  
> > PING [newclient.domain.com](http://newclient.domain.com) (192.168.142.152) 56(84) bytes of data.  
> > 64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=1 ttl=64  
> > time=1.14 ms  
> > 64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=2 ttl=64  
> > time=0.339 ms  
> > 64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=3 ttl=64  
> > time=0.448 ms  
> > 64 bytes from [newclient.domain.com](http://newclient.domain.com) (192.168.142.152): icmp\_seq=4 ttl=64  
> > time=0.396 ms
> > 
> > On Tue, Dec 2, 2014 at 3:34 AM, Nico Kadel-Garcia  
> > [nkadel@skyhookwireless.com](mailto:nkadel@skyhookwireless.com) wrote:
> > 
> > > If your DNS is not fully configured for the node in question, you may  
> > > need to use “-a ipaddress” in order to connect on that basis. I’ve run  
> > > into  
> > > that.
> > > 
> > > Nico Kadel-Garcia
> > > 
> > > Lead DevOps Engineer
> > > 
> > > [nkadel@skyhookwireless.com](mailto:nkadel@skyhookwireless.com)
> > > 
> > > From: kritivagop01 . [[mailto:krithiva.gopal@gmail.com](mailto:krithiva.gopal@gmail.com)]  
> > > Sent: Monday, December 01, 2014 12:57 PM  
> > > To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> > > Subject: [chef] knife ssh not working
> > > 
> > > hi,
> > > 
> > > i am getting error for knife ssh command.
> > > 
> > > FATAL: 1 node found, but does not have the required attribute to  
> > > establish  
> > > the connection. Try setting another attribute to open the connection  
> > > using  
> > > --attribute.
> > > 
> > > please share the details for knife.rb
> > > 
> > > thanks,
> > > 
> > > K.Gopalakrishnan
> 
> --  
> [Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) \* Sorry, I'm ]  
> [WWW: [Julian Dunn's Blog - Commentary on media, technology, and everything in between.](http://www.aquezada.com/staff/julian) \* only Web 1.0 ]  
> [gopher://sdf.org/1/users/keymaker/ \* compliant!]  
> [PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9]

---

<div class="post-metadata">

**Author:** ![Santhosh](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@Santhosh](https://discourse.chef.io/u/Santhosh)\
**Post date:** [December 1, 2014, 6:25pm UTC](https://discourse.chef.io/t/knife-ssh-not-working/6145/6 "2014-12-01T18:25:30Z")

</div>

Hi,  
what's the output of knife node show ?  
it's very likely that fields like FQDN, ip are blank. Have you run  
chef-client atleast once on the node(s).? are you running chef-client  
with override option.? (chef-client -o "recipe[foo]") . override option  
doesn't do node.save.

Regards  
Santhosh  
On 01/12/14 11:27 pm, kritivagop01 . wrote:

> hi,
> 
> i am getting error for knife ssh command.
> 
> FATAL: 1 node found, but does not have the required attribute to  
> establish the connection. Try setting another attribute to open the  
> connection using --attribute.
> 
> please share the details for knife.rb
> 
> thanks,  
> K.Gopalakrishnan

---

<div class="post-metadata">

**Author:** ![Tiago\_Cruz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tiago_cruz/32/49_2.png) [@Tiago\_Cruz](https://discourse.chef.io/u/Tiago_Cruz)\
**Post date:** [December 1, 2014, 6:59pm UTC](https://discourse.chef.io/t/knife-ssh-not-working/6145/7 "2014-12-01T18:59:24Z")

</div>

Try this:

knife ssh "platform:xenserver" -a ipaddress "ls /tmp"

On Mon, Dec 1, 2014 at 4:25 PM, Santhosh [santhoshsusbs@gmail.com](mailto:santhoshsusbs@gmail.com) wrote:

> Hi,  
> what's the output of knife node show ?  
> it's very likely that fields like FQDN, ip are blank. Have you run  
> chef-client atleast once on the node(s).? are you running chef-client with  
> override option.? (chef-client -o "recipe[foo]") . override option doesn't  
> do node.save.
> 
> Regards  
> Santhosh
> 
> On 01/12/14 11:27 pm, kritivagop01 . wrote:
> 
> > hi,
> > 
> > i am getting error for knife ssh command.
> > 
> > FATAL: 1 node found, but does not have the required attribute to  
> > establish the connection. Try setting another attribute to open the  
> > connection using --attribute.
> > 
> > please share the details for knife.rb
> > 
> > thanks,  
> > K.Gopalakrishnan

--  
-- Tiago Cruz
